Player is hurt when touching barbed wire
Moderator: Moderators
-
HotShizzle
- Corporal
- Posts: 25
- Joined: Wed Apr 28, 2004 1:22 am
- Contact:
Player is hurt when touching barbed wire
I need some help with a barbed wire when touched will cause damage to the player....ive seen something with when the player touches the trigger he gets hurt, but ive forgot where the tut was....i know i have to assign the barbed wire with a target name and then do something with a if statement and local.player....can someone give me the solution...im sure its really simple...
~.::[FS] 4 LyF3::.~
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
well te if functino isn't needed
place a trigger_multiple around the barbed wire, and put
key: setthread
value: hurt_me
key: targetname
value: barbed_wire
on in the in the script have
hurt_me:
$barbed_wire volumedamage 1000
end
//1000 will kill the player
place a trigger_multiple around the barbed wire, and put
key: setthread
value: hurt_me
key: targetname
value: barbed_wire
on in the in the script have
hurt_me:
$barbed_wire volumedamage 1000
end
//1000 will kill the player
hope this helps, prob not cos it's all foreign 2 me :-/
-
HotShizzle
- Corporal
- Posts: 25
- Joined: Wed Apr 28, 2004 1:22 am
- Contact:
kill
Nuggets little thread will kill the player with one touch, I think. So, you should probably try a smaller value. A trigger multiple fires every .2 seconds, unless you change it with key/value wait/1 .
hurt_me:
$barbed_wire volumedamage 10
end
Here is another way.
"10" is how much damage there will be every second. For this method, there is no setthread in the trigger and the thread must be started under prespawn or spawn ( thread hurt_me ).
hurt_me:
$barbed_wire volumedamage 10
end
Here is another way.
Code: Select all
hurt_me:
$barbed_wire waitill trigger
local.sucker = parm.other
if (local.sucker istouching $barbed_wire)
{
radiusdamage local.sucker.origin 10 16
}
wait 1
goto hurt_me
end
- HDL_CinC_Dragon
- Brigadier General
- Posts: 574
- Joined: Mon Dec 22, 2003 8:32 pm
are those two lines neccesary?nuggets wrote:well te if functino isn't needed
place a trigger_multiple around the barbed wire, and put
key: setthread
value: hurt_me
key: targetname
value: barbed_wire
on in the in the script have
hurt_me:
$barbed_wire volumedamage 1000
end
//1000 will kill the player
setthread makes the trigger start the thread when triggered without it you would have to run the thread and put waittill trigger in it like in tltrude's example . Either way will work . If you have more than one set of barbwire I would change it so every trigger around any barbwire ran this thread with setthread .
hurt_me:
local.player = parm.other
local.player hurt 10
end
or if each trigger ran the same thread without useing setthread
main:
$barb1_trigger thread hurt_me
$barb2_trigger thread hurt_me
$barb3_trigger thread hurt_me
end
hurt_me:
while(1){
self waittill trigger
local.player = parm.other
while(local.player istouching self)
{
local.player hurt 10
wait 1
}}
end
there are other ways of doing it too it is up to you how you do it .
hurt_me:
local.player = parm.other
local.player hurt 10
end
or if each trigger ran the same thread without useing setthread
main:
$barb1_trigger thread hurt_me
$barb2_trigger thread hurt_me
$barb3_trigger thread hurt_me
end
hurt_me:
while(1){
self waittill trigger
local.player = parm.other
while(local.player istouching self)
{
local.player hurt 10
wait 1
}}
end
there are other ways of doing it too it is up to you how you do it .


