Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2301 302 303338 339 Next To the start

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
@factis699 try this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
_rteam = {[1] = "ct", [2] = "t", [0] = "spec"}
function swapsides()
     for p = 1, 32, 1 do
          if player(p, "exists") then
               msg("Server Teams have being swapped")
               parse(string.format("make%s %s", _rteam[player(p, "team")], p))
          end
     end
end

addhook("endround","change_tea")
function change_tea()
	swapsides()
end

Swap Team script by "Lee Gao"

old Re: Lua Scripts/Questions/Help

Loooser
User Off Offline

Quote
try
1
2
3
4
5
6
7
8
9
addhook("startround","startround")
function startround()
for i = 1, 32 do 
if player(i,"exists") then
if player(i,"bot") then
parse("maket "..i)
end
end
end

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
loooser has written
try
1
2
3
4
5
6
7
8
9
addhook("startround","startround")
function startround()
	for i = 1, 32 do 
		if player(i,"exists") then
			if player(i,"bot") then
				parse("maket "..i)
			end
		end
	end


1 end missing and the function musn't have the same name as the hook

like this:

1
2
3
4
5
6
7
8
9
10
addhook("startround","startrounder")
function startrounder()
	for i = 1, 32 do 
		if player(i,"exists") then
			if player(i,"bot") then
				parse("maket "..i)
			end
		end
	end
end
edited 1×, last 06.11.10 01:01:53 pm

old Re: Lua Scripts/Questions/Help

Infinite Rain
Reviewer Off Offline

Quote
Thanks Guys!!!
Your best!
P.S
I need score

For example:
Player1(me) Have 200 scores
and for 200 scores i can buy weapon
just press on F2 Button or say !buyweapon
or something like that
Thanks!
edited 2×, last 06.11.10 12:12:36 pm

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
steam-cs2d has written
hi

can anybody tell how do like you say !maniac he teleport to y5 x4 tiles


I dont know if this is correct but this is my try :

1
2
3
4
5
6
7
addhook("say","tele")
function tele(id,txt)
if txt == "!maniac" then
parse("sv_msg2 "..id.." I like Pie...")
parse("setpos "..id.." 4 5")
end
end

But i dont know how to make it for tiles...
Search in map editor pixels and then put x pixels instead of 4 and y pixels instead of 5

Sorry that without Tab

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
batlaizys has written
steam-cs2d has written
hi

can anybody tell how do like you say !maniac he teleport to y5 x4 tiles


I dont know if this is correct but this is my try :

1
2
3
4
5
6
7
addhook("say","tele")
function tele(id,txt)
if txt == "!maniac" then
parse("sv_msg2 "..id.." I like Pie...")
parse("setpos "..id.." 4 5")
end
end

But i dont know how to make it for tiles...
Search in map editor pixels and then put x pixels instead of 4 and y pixels instead of 5

Sorry that without Tab


X: 4 * 32
Y: 5 * 32

Try that, it may work.

old Re: Lua Scripts/Questions/Help

Mechanolith
User Off Offline

Quote
Hey guys, i suck in making scripts, so i could ask to someone to make a easy one: like, every roundstart it will trigger some entity on the map, it's for players don't falsify/use some maps that i don't want on other servers...
Please can someone help? .-.
Reward: cookie Apple

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
no thanks i prefer potato
can some 1 help me with a thing !
like if i throw granade i can see where its launched ( x and y )
but can it be the same with granade launcher or with rocket launcher ?

old Re: Lua Scripts/Questions/Help

Fehu
User Off Offline

Quote
TDShuft has written
no thanks i prefer potato
can some 1 help me with a thing !
like if i throw granade i can see where its launched ( x and y )
but can it be the same with granade launcher or with rocket launcher ?


1
2
3
4
addhook("projectile","where")
function where(id,weapon,x,y)
	msg2(id,"©000255000Your Throw Grenade on X:"..x.." Y:"..y.." position!@C")
end
Here you are

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
Fehuziom has written
TDShuft has written
no thanks i prefer potato
can some 1 help me with a thing !
like if i throw granade i can see where its launched ( x and y )
but can it be the same with granade launcher or with rocket launcher ?


1
2
3
4
addhook("projectile","where")
function where(id,weapon,x,y)
	msg2(id,"©000255000Your Throw Grenade on X:"..x.." Y:"..y.." position!@C")
end
Here you are

... i know that
im asking if you can use projectile with granade launcher and rocket launcher --'

old Re: Lua Scripts/Questions/Help

Fehu
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
addhook("projectile","where")
function where(id,weapon,x,y)
	if (weapon==47) then
		msg2(id,"©000255000Your Rocket Explode on X:"..x.." Y:"..y.." position!@C")
	end
	if (weapon==48) then
		msg2(id,"©000255000Your Rocket Explode on X:"..x.." Y:"..y.." position!@C")
	end
end
Now its okay ?...

old Re: Lua Scripts/Questions/Help

Mechanolith
User Off Offline

Quote
Man... it haven't worked, i've done this:
1
2
3
4
addhook("startround","starting")
	function starting(mode)
		parse("trigger ENTITY_NAME")
end
what i have to change to it trigger the entity every roundstart? please someone help!

old Re: Lua Scripts/Questions/Help

Kostyan1996
User Off Offline

Quote
Help me, plz! What am I doing wrong:
1
2
3
4
5
6
addhook("hit","lol")
function lol()
if player(0,"health"==1) then
parse=player(0,"speedmod"==0)
end
end
I want to be when HP = 0 speedmod was 0.
Thanks in advance.

old Re: Lua Scripts/Questions/Help

Mechanolith
User Off Offline

Quote
Please, what im doing worng? can someone help?
1
2
3
4
addhook("startround","starting")
     function starting(mode)
          parse("trigger ENTITY_NAME")
end
I want to every roundstart it will trigger a entity on the map, on ENTITY_NAME i put the name of the entity that i want to trigger and it still dont works, please i need help
To the start Previous 1 2301 302 303338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview