English No-Damage zone code in if_trigger ?

11 replies
Goto Page
To the start Previous 1 Next To the start
Up
Qater
User
Offline Off
Hello, I want code for No-Damage zone in trigger if_
And how I can use it?
I want to add if_trigger with this code to my map.
Thanks.
Actions speak louder than words.
16.03.14 06:40:54 pm
Up
nikolaXX
User
Offline Off
well 1 you could add env_no_weapons in the game or just 1 actual team like only cts or only ts
Up
Qater
User
Offline Off
I creating COOP map.
In the map are CTs, Ts and VIP.
Actions speak louder than words.
16.03.14 06:51:37 pm
Up
Infinite Rain
Reviewer
Offline Off
Here's a template:
Code:
1
2
3
4
(function()
     -- CODE HERE
     return false
end)()
A thousand may fall at your side, ten thousand at your right hand, but it will not come near you. You will only look with your eyes and see the recompense of the wicked. - Psalm 91:7-8 ESV
16.03.14 06:53:29 pm
Up
Qater
User
Offline Off
I never scripting, I dont know what is this and what I must doing
Actions speak louder than words.
16.03.14 06:56:32 pm
Up
nikolaXX
User
Offline Off
ok well 1 the cts,ts,and vips cant be that retarted that theyll shoot them selfs right? i mean just make a path 1 for vip 1 for ct and 1 for t what else can i say?
16.03.14 07:00:14 pm
Up
Qater
User
Offline Off
I want to go side by side.
I want a code! Not swearing!
Actions speak louder than words.
16.03.14 07:01:31 pm
Up
Apache uwu
User
Offline Off
So essentially you want a no damage tile, in that case, it would be best to have something like:

Code:
1
2
3
4
5
6
7
8
9
addhook("hit", "_hit")

function _hit(id)
     local x = player(id, "tilex")
     local y = player(id, "tiley")
     if entity(x, y, "typename") == "Trigger_If" then
          return 1
     end
end


If the player being damaged (hit) on is on the same tile as a trigger if, then ignore the hit.
16.03.14 07:04:00 pm
Up
Qater
User
Offline Off
This code I must write to the if_trigger?
Actions speak louder than words.
16.03.14 07:29:36 pm
Up
Apache uwu
User
Offline Off
If you want the lua to be transferred with every player that joins, simply name the lua script the same as the map (but have .lua, for example: de_dust.map -> de_dust.lua), and also have it within /maps.

Or, place the code in server.lua or autorun/. If_trigger is really not the place to be placing high amounts of code.
16.03.14 07:30:05 pm
Up
DC
Admin
Offline Off
Trigger_If is not made for such scripts. Don't abuse it.
Instead create a script file in the maps folder which is called like your map but with .lua file extension and put your script into it.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
16.03.14 07:34:23 pm
Up
Qater
User
Offline Off
@user DC: Okay, okay, okay god.
Thank you for answer.
Actions speak louder than words.
To the start Previous 1 Next To the start