English check for doors and lasers

2 replies
Goto Page
To the start Previous 1 Next To the start
25.08.22 06:13:14 pm
Up
khaled1968
User
Offline Off
Hey, I'm making house script and I encountered some problems when player leaves...

I want to know how to check for doors and lasers if player left the server. For example: Let's say that player has a house (house[id] == 1) and that house's door tilex is 15 and tiley is 20, and when player leaves, the script checks that specific tile to see if there was a wall there or not. If there was no wall then It won't do anything, If there was a wall then it will be removed!

If that was possible which I believe it is, will it be done in the same way for lasers & team gates ?
25.08.22 06:33:20 pm
Up
Mora
User
Offline Off
Use @cs2d cmd triggerposition
Check with @cs2d lua cmd entity
Code:
1
2
3
4
5
if house[id] == 1 then
 if entity(15,20,'state') then
 parse('triggerposition 15 20')
 end
end

Keep in mind that false in 'state' means Visible(wall or image), true in 'state' means it closed.
The same way You can trigger lasers depending on house, but also, if Your trigger has nickname use @cs2d cmd trigger
parse('trigger laservip1')


/Write it with my phone so excuse for bad explanation
25.08.22 08:46:54 pm
Up
khaled1968
User
Offline Off
@user Mora: Great explanation! Thanks
To the start Previous 1 Next To the start