Forum

> > CS2D > Scripts > Code doesn't work
Forums overviewCS2D overview Scripts overviewLog in to reply

English Code doesn't work

3 replies
To the start Previous 1 Next To the start

old Code doesn't work

EngiN33R
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
if (player(0,"table")[curplayer]) then
	hale=player(0,"table")[curplayer]
	for _,i in ipairs(player(0,"table")) do
		if (i~=hale) then
			parse("makect "..i)
		end
	end
	parse("maket "..hale)
end

The code above is in a startround hook. The curplayer variable is defined. Why doesn't the code work? Please help. Thanks in advance.

old Re: Code doesn't work

Deleted User

Quote
Theres any errors?

BTW Did you try this?
1
k = player(0, 'table')

So...

1
if k[curplayer] then

IDK Might work

old Re: Code doesn't work

EngiN33R
Moderator Off Offline

Quote
There are no errors, and it works how I have it just fine. I only have problems with moving players to different teams (maket, makect).

old Re: Code doesn't work

DC
Admin Off Offline

Quote
• first: check if your script is executed properly. add console outputs for debugging

• if everything is executed: internal game functions may set the teams automatically and overwrite what you do in your script.
try a delayed execution of your script (cs2d lua cmd timer)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview