tele anti spawn kill

Post your scripting questions / solutions here

Moderator: Moderators

Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

tele anti spawn kill

Post by Tazz »

just wondering guys if something like this would work...i cant test this myself as i dont have a server i am making it for clan server....heres the script...i just took basic tele and then added nodamage at end and wondering if it will work

Code: Select all

teletrig:
local.smoke1 = spawn script_model model "static/corona_reg.tik"
local.smoke1 origin ( 1941 104 509  )
local.smoke1 light 1 1 1 35 // r g b radius  
local.smoke1 scale 1
local.smoke1 notsolid
local.trig = spawn trigger_multiple
local.trig.origin = ( 1941 104 509 )
local.trig setsize ( -50 -50 -50 ) ( 50 50 50 )
local.trig targetname port
$port setthread teleport
end
teleport:
self waittill trigger
local.player = parm.other
local.player tele ( 5933 -2103 539 )
local.player nodamage
wait 3
local.player takedamage 
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Yeah it should work, just mind that the 'self waittill trigger' is obsolete and there's no 'end' in the setthread. Targetname is a property not a command.

Code: Select all

teletrig:
local.smoke1 = spawn script_model model "static/corona_reg.tik"
local.smoke1 origin ( 1941 104 509  )
local.smoke1 light 1 1 1 35 // r g b radius 
local.smoke1 scale 1
local.smoke1 notsolid
local.trig = spawn trigger_multiple
local.trig.origin = ( 1941 104 509 )
local.trig setsize ( -50 -50 -50 ) ( 50 50 50 )
local.trig.targetname = "port"
$port setthread teleport
end
teleport:
local.player = parm.other
local.player tele ( 5933 -2103 539 )
local.player nodamage
wait 3
local.player takedamage
end
Just test it LAN like all of us modders do.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

$oldier Of Ra wrote:Targetname is a property not a command.
Actually, it's both. Check the g_allclasses doc, there are 3 entries for it (read property, write property and command).
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

Post by Tazz »

would an end in the setthread make it not work on server?.....i tried it on a buddys machine and it worked fine but when i put on clan server it wouldnt work.....just wondering, although it could be conflicting mods but im not sure as i dont know all what is on server
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

No. The setthread is a thread, therefor it must end at some point.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

even if it makes no difference in my oppinion, try to put away these 2:

Code: Select all

teletrig:
&

Code: Select all

end
(the first one) it's possible that there's a confilct or something like that, when I spawn triggers I don't put them in methods or threads(if not necessary..and never had problems)..
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

If you delete the first end then you WILL have some errors in the console because the script will not stop and execute the teleport thread. Since it has not been triggered, parm.other is NIL, therefor local.player will be NIL and you cannot teleport "nothing".

If you delete the second end, then the script will continue and execute everything in its path until it finds an "end" command.

If you delete the "teleport:" line then your trigger won't work. If you delete the "teletrig:" line then you cannot execute that thread to spawn the trigger therefor it won't work either.

It's absolutely absurd that a thread or an "end" command can not make it work on a server. It's possible one of your other scripts running is so messed up that the engine starts to flip.

Could you show me the console log?
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

try this one..that's what I was saying before, even if what SoR said is right...

Code: Select all

local.smoke1 = spawn script_model model "static/corona_reg.tik" 
local.smoke1 origin ( 1941 104 509  ) 
local.smoke1 light 1 1 1 35 // r g b radius 
local.smoke1 scale 1 
local.smoke1 notsolid

local.trig = spawn trigger_multiple
local.trig.origin = ( 1941 104 509 ) 
local.trig setsize ( -50 -50 -50 ) ( 50 50 50 ) 
local.trig setthread  Trigger1

Trigger1:
local.player=parm.other
if (local.player.isTrigger1==1) 

local.player.isTrigger1=1 
local.player tele ( 5933 -2103 539 ) 
local.player nodamage 
wait 3 
local.player takedamage 
local.player.isTrigger1=0 
end 
Last edited by SilentAngel on Sun Apr 26, 2009 10:10 pm, edited 2 times in total.
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

What I said is right. ;)
But I'm glad to see scripters are still contributing to errors.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

well..the script I've posted works and I'm running it on my server,the only one difference between this one and the one I run is in the thread executed by the trig...the script I run kill you when triggered, and it's structured as the one I posted so this one should work..and there are a lot of things that make a trigger not run, for exemple the thread name that is executed, or the method where it's placed..there can be a conflict, so if you don't put it in a method there won't be any problem.......however if there's a problem of names thst's the solution...
Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

Post by Tazz »

Silent ill try ur script and see how it works out....SoR i cant show u console log as i dont have access to up to the server...i have to give to soemone else and let them do it...=(...i know it sux but i guess they dont trust me enough yet lol.....ill see if one of the guys that tested it will give me the console error and ill post here if so.....thanx for the help guys
sdlall
Sergeant Major
Posts: 110
Joined: Tue Mar 24, 2009 11:41 pm

Post by sdlall »

Here is the one is use it is sort of like what you are doing. I believe I got it off of one of UncleBobs maps.

Code: Select all

teleporter2: //tank road center up

local.ent = spawn script_model targetname ent2
local.ent model "emitters/welding_spark.tik"
local.ent.origin = ( -2526 -764 296 )
local.ent scale .5

local.teletrig = spawn trigger_multiple targetname tele_trig2
local.teletrig.origin = ( -2526 -764 296 )
local.teletrig setsize ( -20 -20 0 ) ( 20 20 30 )
local.teletrig setthread teleport_player2

end

teleport_player2: 

local.player = parm.other
$tele_trig2 nottriggerable
$tele_trig2 hide
$ent2 hide

local.player tele ( -2452 -576 600 )
local.player iprint ("You climbed the wall!")
local.player nodamage //allow anti spawnkill
local.player light 1 0 0 50

wait 2

local.player takedamage
local.player lightoff

$ent2 show
$tele_trig2 show
$tele_trig2 triggerable

end
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

I forgot to say that in the case of my script you havo to exec it in prespawn..for exemple I had it in another scr and I've did this:
level waittill prespawn
exec maps/dm/malta_nocross.scr //where malta_nocross.scr is my script
however there are other ways..
but I think the problem is not the scr but something else couse the scr you made shold work..it has no errors... :? strange case..
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

So they added the trigger. Then it's obvious they did it the wrong way.

SilentAngel, it's not a matter of "will my crappy script work because the scripting rules are so permissive?" it's a matter of "do I make scripts the newbie way or the good way?".
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

I think you don't follow me..I'm not saying that my script is the solution, it's just a way to see if the problem was in the method name or other..
Also as I said a lot of times I'm not a master..but I know what I say..maybe you're better in MOH Scripts but you're one of those who believe to know everything and that's bad becouse is not true! so insted of criticize me try to learn something new!
talking about what I was saying before:
if you put something out of a method as I'm doing it still can be read, just come in my server and see it on your own...so don't say "IT DON'T WORK" becouse it's compleatly wrong...and if you still think I'm wrong, well..that's not my problem..
Also, he said that his scr was working on his friend's server so it must be a conflict of names/mods or something like that becouse his scr works...
well..time for a coffie..see ya
Post Reply