Forum

> > CS2D > Scripts > [lua]Trigger Funcion
Forums overviewCS2D overview Scripts overviewLog in to reply

English [lua]Trigger Funcion

4 replies
To the start Previous 1 Next To the start

moved [lua]Trigger Funcion

X-Files
User Off Offline

Quote
hi,i maked vip house

but all players can go there

i want only,vip can open door

only vip user can use this trigger

how to make it ??

old Re: [lua]Trigger Funcion

EngiN33R
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
vip=1 -- Put VIP's USGN here
doorx=1 -- Put door's X tile position
doory=1 -- Put door's Y tile position
doortr="vipdoor" -- Put door's entity name (entity name in editor)

addhook("use","vipdoor")
function vipdoor(id)
	if (player(id,"tilex")==doorx and player(id,"tiley")==doory and player(id,"usgn")==vip) then
		parse("trigger "..doortr)
	end
end

old Re: [lua]Trigger Funcion

robed
User Off Offline

Quote
hey @engiN33R

how about only the USGN.ID can enter plss tell me

it this like this

player=1 -- Put PLAYER's USGN here
doorx=1 -- Put door's X tile position
doory=1 -- Put door's Y tile position
doortr="vipdoor" -- Put door's entity name (entity name in editor)

addhook("use","playerdoor")
function playerdoor(id)
if (player(id,"tilex")==doorx and player(id,"tiley")==doory and player(id,"usgn")==player) then
parse("trigger "..doortr)
end
end


is that like that

old Re: [lua]Trigger Funcion

EngiN33R
Moderator Off Offline

Quote
@X-Files no problem, I'm always ready to help
@ROBED2 I can't really understand what you're saying. PM me, don't write in this thread.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview