Forum

> > CS2D > Scripts > Setpos lua error.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Setpos lua error.

15 replies
To the start Previous 1 Next To the start

old Setpos lua error.

Yates
Reviewer Off Offline

Quote
I have this setpos lua, when you spawn and if your usgn is in the lua you spawn somewhere else. In this case 817 1978.
But I got an error in the console.
')' expected near '1978'
And I can't figure out why it gives me this, I mean it has an ) so wtf?
1
2
3
4
5
6
7
8
addhook(spawn,fgspawn)
function fgspawn(id)
for id=1,32 do
if player(id,usgn)==21431 then
parse(setpos ..id.. 817 1978)
end
end
end
It did work, but now suddenly doesn't. Very annoying actually.
So, anyone know what's wrong?
Thanks.

old Re: Setpos lua error.

Yasday
User Off Offline

Quote
You should use strings:
"usgn"
"setpos " .. id .. " 817 1978"
and you should delete that for id = 1, 32 do, because the id parameter is already given ( and I don't think you want to be teleported when someone spawns ).

old Re: Setpos lua error.

Yates
Reviewer Off Offline

Quote
So. What i understand.
1
2
3
4
5
6
7
addhook(spawn,fgspawn)
function fgspawn(id)
if player(id,"usgn")==21431 then
parse("setpos " ..id.. " 817 1978")
end
end
end

old Re: Setpos lua error.

Precel97
User Off Offline

Quote
Semsi! Read rules... Add this to your theard.Off topic
edited 1×, last 25.04.11 12:34:08 pm

old Re: Setpos lua error.

Yasday
User Off Offline

Quote
@semisi
This hasn't anything to do with the script, has it?

They're created like every other map, by opening the editor and mapping.

old Re: Setpos lua error.

Surplus
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
adminlist={"USIDHER","USIDHER","USIDHER"}

addhook(spawn,fgspawn)
function fgspawn(id)
for index,USGN in ipairs(adminlist) do
if player(id,usgn)== USGN
parse(setpos ..id.. 817 1978)
end
end

Your script turned into multiple usgn system thing. Dunno whats it called. Might work.

EDIT: Forgot to edit a thing, should work now
edited 1×, last 25.04.11 01:18:14 pm

old Re: Setpos lua error.

Yasday
User Off Offline

Quote
It won't work. Try it and you'll see that it's shit. No strings, false table and so on...
Edit:
Won't work anyways.

old Re: Setpos lua error.

loldlold123
User Off Offline

Quote
addhook(spawn,fgspawn)
function fgspawn(id)
for id=1,32 do
if player(id,usgn)==21431 then
parse(setpos ..id.. 817 1978)
end
end
end

are you joking there is no ( " ) and for id =1,32 do is junk

addhook("spawn","fgspawn")
function fgspawn(id)
if player(id,usgn)==21431 then
parse("setpos "..id.." 817 1978")
end
end

this is correct
edited 1×, last 25.04.11 08:49:34 pm

old Re: Setpos lua error.

Yates
Reviewer Off Offline

Quote
Yes, I know.
I didn't make it I got it, and it used to work.
One answer is enough, you don't have to repeat it, no use.

old Re: Setpos lua error.

Yasday
User Off Offline

Quote
user loldlold123 has written
addhook(spawn,fgspawn)
function fgspawn(id)
for id=1,32 do
if player(id,usgn)==21431 then
parse(setpos ..id.. 817 1978)
end
end
end

are you joking there is no ( " ) and for id =1,32 do is junk

addhook("spawn","fgspawn")
function fgspawn(id)
if player(id,usgn)==21431 then
parse("setpos "..id.." 817 1978")
end
end

this is correct

Did you even try to read the whole thread?

old Re: Setpos lua error.

loldlold123
User Off Offline

Quote
user Yates has written
So. What i understand.
1
2
3
4
5
6
7
addhook(spawn,fgspawn)
function fgspawn(id)
if player(id,"usgn")==21431 then
parse("setpos " ..id.. " 817 1978")
end
end
end


addhook((here)spawn(here),(here)fgspawn(here))
function fgspawn(id)
if player(id,"usgn")==21431 then
parse("setpos " ..id.. " 817 1978")
end
end
end

can you see "here"

old Re: Setpos lua error.

loldlold123
User Off Offline

Quote
ok im sorry but i dont see last posted code " near hook and i post it...pls dont continue to say somethings.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview