Forum
CS2D Scripts Lua Scripts/Questions/Help BureX has written
DarkByte i always get this error i even replaced '\'
like "\gate field"\ and \"gate field"\ and many stuff but still doesnt work
DarkByte i always get this error i even replaced '\'
like "\gate field"\ and \"gate field"\ and many stuff but still doesnt work
just use lua
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("buildattempt","nobuild") function nobuild(id,type,x,y) 	if type==1 then 		msg2(id,"©255000000You cant build this type of building@C") 		return 1 	elseif type>=6 and type<=7 then 		msg2(id,"©255000000You cant build this type of building@C") 		return 1 	elseif type==9 then 		msg2(id,"©255000000You cant build this type of building@C") 		return 1 	end end
here are the building id's
1 - Barricade
2 - Barbed Wire
3 - Wall I
4 - Wall II
5 - Wall III
6 - Gate Field
7 - Dispenser
8 - Turret
9 - Supply
10 - Construction Site
11 - Dual Turret
12 - Triple Turret
13 - Teleporter Entrance
14 - Teleporter Exit
20 - Mine
21 - Laser Mine
22 - Orange Portal
23 - Blue Portal
Skipper has written
Is it possible to make command look like:
I want that a player is just moving a pixel downwards.
I hope you can help.
1
parse("setpos '..id..' '..x..' '..y..'-1)
I hope you can help.
The it should be
1
parse("setpos "..id.." "..x.." "..y-1)
Nelight has written
How to make script than when i attack with laser i do no damage?
1
2
3
4
5
2
3
4
5
addhook("hit","nohit") function nohit(id,src,wpn) 	if wpn==45 then 		return 1 	end end
maPmaKer has written
Does anybody knows a lua to replace the normal fog of war with a flashlight so it would look like flashlight?
Still need help with this. Any ideas? Any codes?
Banaan has written
The it should be
Skipper has written
Is it possible to make command look like:
I want that a player is just moving a pixel downwards.
I hope you can help.
1
parse("setpos '..id..' '..x..' '..y..'-1)
I hope you can help.
The it should be
1
parse("setpos "..id.." "..x.." "..y-1)
hmm this would just work like this i think or?
1
2
2
local x,y = player(id,'x'),player(id,'y') parse("setpos "..id.." "..x.." "..y-1)
bh_item(itemid,"name")
or
bh_item(itemid,"price")
?
also can some 1 say what "~=" does ??
edited 1×, last 24.10.10 04:54:10 pm
== "the same"
>="bigger and the same"
<="smaller and the same"
>"bigger"
<"smaller
TDShuft has written
also can some 1 say what "~=" does ??
if someone is not == then its ~=
as example
"if not x == y then " = " if x ~= y then "
beckerchen has written
"if not x == y then " = " if x ~= y then "
That's not completely correct, == has one of the lowest order of operator precedence so that
1
not x == y
1
(not x) == y
1
not (x == y)
If so, can I have scripts or ideas?
Any code?
Arcas has written
Is it possible to make a script that is triggered by an in-map trigger?
If so, can I have scripts or ideas?
If so, can I have scripts or ideas?
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
trigger(trigger,source)					on trigger (once per trigger) -trigger: trigger name -source: triggered by 0=map/1=script >return:	0 - proceed normally 		1 - don't trigger triggerentity(x,y)					on trigger (for triggered entities) -x: entity x position (tiles) -y: entity y position (tiles) >return:	0 - proceed normally 		1 - don't trigger
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
addhook("trigger","trigger") function trigger(t,s) if t=="triggername" then --your script here end end --or addhook("triggerentity","trigger") function triggerentity(x,y) if x==xtile and y==ytile then --your script here end end
Yasday has written
hmm this would just work like this i think or?
Banaan has written
The it should be
Skipper has written
Is it possible to make command look like:
I want that a player is just moving a pixel downwards.
I hope you can help.
1
parse("setpos '..id..' '..x..' '..y..'-1)
I hope you can help.
The it should be
1
parse("setpos "..id.." "..x.." "..y-1)
hmm this would just work like this i think or?
1
2
2
local x,y = player(id,'x'),player(id,'y') parse("setpos "..id.." "..x.." "..y-1)
Yes it would.
Yet a shift of 1 pixel is really tiny, that's 1/32 or 0,03125 tiles.
TDShuft has written
Example :
next time take a look in info.txt in your lua files
Arcas has written
Is it possible to make a script that is triggered by an in-map trigger?
If so, can I have scripts or ideas?
If so, can I have scripts or ideas?
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
trigger(trigger,source)					on trigger (once per trigger) -trigger: trigger name -source: triggered by 0=map/1=script >return:	0 - proceed normally 		1 - don't trigger triggerentity(x,y)					on trigger (for triggered entities) -x: entity x position (tiles) -y: entity y position (tiles) >return:	0 - proceed normally 		1 - don't trigger
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
addhook("trigger","trigger") function trigger(t,s) if t=="triggername" then --your script here end end --or addhook("triggerentity","trigger") function triggerentity(x,y) if x==xtile and y==ytile then --your script here end end
Okay, Ill take a look at it.
Btw, thanks for explaining it