Forum
CS2D Scripts Lua Scripts/Questions/Helpdo you mean something like "!kickplayer xyz" or something like that?
1
parse('flashplayer '..id..' 50')
The problem is that the variable id is nil.
1
parse("flashplayer "..id.." 50") -- ERROR- id has not been initialized
1
2
2
id = 1 -- id has been initialized parse("flashplayer "..id.." 50") -- no error
Here is my script
Here's the weiwen's script:
CAN ANYBODY SHOW ME A SCRIPT LIKE THIS??
1) Where can i download Fifa2D mod?
2) Where is mod from server "modded"?
say plz
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("spawn","spw") function spw(id) 	if (pl_loaded[id]==0) then 		mes(id,1) 	else 		parse('sv_sound2 '..id..' rpg/sounds/other/respawn.wav') 		parse('setpos '..id..' '..pl_savedx[id]..' '..pl_savedy[id]) 		parse('speedmod '..id..' '..rpg_speedmod[pl_sk[id][2]]) 		resetallhud(id) 	end 	parse('flashplayer '..id..' 50') end
1
2
3
4
5
2
3
4
5
for id = 1, 32 do 	if player(id,"exists") then 		parse("flashplayer "..id.." 50") 	end end
maybe this
edited 2×, last 25.06.10 08:39:37 pm
It dont work:
1
2
3
4
2
3
4
addhook("startround","wall") function wall() 	parse("spawnobject "..math.random(3,5).." "..math.random(1,14).." "..math.random(154,164).." 0 1 0 0") end
P.S: Map tiles: 15x15
P.S: Sorry for my bad english
edited 3×, last 25.06.10 10:22:44 pm
The quotes won't matter, but you could also use this.
1
2
3
4
5
2
3
4
5
for id = 1, 32 do if player(id,[[exists]]) then parse([[flashplayer ]]..id..[[ 50]]) end end
@KINGGOLDrus
See if there are any errors in the console.
btw what is mes(id,1)?
Edit
I need your full script otherwise I will keep getting an error. If that is your whole script then I know the problem.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("startround","wall") function wall() local wall1 = math.random(0,10) local wall2 = math.random(0,10) local wall3 = math.random(0,10) x = math.random(1, map("xsize")) -- or if tiles 15x15, x = math.random(1,15) y = math.random(1, map("ysize")) -- here too 	for id = 1, wall1 do 		parse("spawnobject 3 " "..x.." "..y) 	end 	for id = 1, wall2 do 		parse("spawnobject 4 " "..x.." "..y) 	end 	for id = 1, wall3 do 		parse("spawnobject 5 " "..x.." "..y) 	end end
try this, i not tested it. maybe it should work.
I want a simple lua, just like in editor we have "trigger_start".
Cuz I need this trigger only to my server, and people that try use my map will fail.
kind of trigger start "seckey" <-- thats what I need
(prefer using lua instead of putting it in map)
THX
1
2
3
4
5
2
3
4
5
addhook("startround", "sr") trigger = "" -- what to trigger function sr () 	parse("trigger " .. trigger) end
with
trigger = "<what to trigger>"
vesa-omar has written
Ok, Im trying to do when you throw an Smoke it freeze's the one's it hit.
But i cant get it to work
But i cant get it to work
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--Weapons-- addhook("projectile","hnsteam_smokecus") function hnsteam_smokecus(id,weapon,x,y) if (weapon==53) then 		parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 128') 		parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 128') 		return 1 	end end addhook("hit","hnsteam_smokefreeze") function hnsteam_freeze(target,weapon) if (weapon==53) then 		parse("speedmod "..target.." -100") 		return 1 	end end
hit function will never be called when u hit with a smoke grenade, that's what projectile hook is for. So check in the projectile hook for every player if he's close to the grenade.
AaAaA Plisi no more chalenges in lua :S first you can test it okay? :X
CAN ANYBODY SHOW ME A SCRIPT LIKE THIS PLS PLS??
I am repeating me but there is no good answer
care yourself ...