With this script it doesn't work and trig is actived when i move around the triggers...
thanks you for reading this and double thank you to try to help me ^^
Code Snippet
Plaintext
Crane3() { Crane3 = getEnt("crane3", "targetname"); Crane3_trig = getEnt("crane3_trig", "targetname"); hatchet_detect = spawn("script_model", self.origin); hatchet_detect.angles = self.angles; hatchet_detect setmodel("viewmodel_bo2_hachet"); // moved this outside the loop so you dont keep spawning models while(true) {
//Crane3_trig waittill("trigger", hatchet_detect); this waits till a player hits the trig -_- then defines the player as hatchet_detect if(hatchet_detect isTouching(Crane3_trig)) { iprintlnbold("ok"); } wait .5; // this wait is really important } }
Comment are very useful! but i just know when and why put wait?
script don't work : in game i see "ok" show up in looping but after modification i replaced:
Code Snippet
Plaintext
if(hatchet_detect isTouching(Crane3_trig))
by:
Code Snippet
Plaintext
if( IsDefined( hatchet_detect.HitTrigger ) )
And now trigger says in looping that trigger is not trigered (i have also add a
Code Snippet
Plaintext
else { iprintlnbold("not trigered") }
) even when i launch my tomahawh in trig /:
If you simply replaced:
Code Snippet
Plaintext
if(hatchet_detect isTouching(Crane3_trig))
with
Code Snippet
Plaintext
if( IsDefined( hatchet_detect.HitTrigger ) )
That wont work.. Isdefined only checks if the ent or var exists and then returns true or false. I dont see you define hatchet_detect.HitTrigger anywhere, so it will just return false..
Also not sure what you're trying to do here, so cant really give any advice on how to do it