help with making a delayed trigger

Posted by Rubriccode on Tue 08 Oct 2024 05:44 PM — 3 posts, 5,687 views.

#0
i have searched through the forum and I am completely lost, and the scripting tutorial doesn't show what I want to do or I just don't understand it.

I am trying to make a trigger that does something after 5 seconds. when I tried to do the send to world(speedwalk) and having speedwalk set to 5000 miliseconds it didn't fire at all.

so I am trying to do it through a script

in the script file I have the follow I got from another post on the forum changed to fit what I need.

sub OnLax(tname, line, wildcards)
world.DoAfter 5, "tug light"
end sub

and it gives me an error i dont understand
Error number: 0
Event: Compile error
Description: [string "Script file"]:1: '=' expected near 'OnLax'
Called by: Immediate execution


i have the trigger set to send to world
the label field is tug
the script field is OnLax
enabled is checked

I do not know what I am doing so do not know what I am doing wrong.

please help
#1
I think I figured it out finally. I was got a little confused

so in the send box I put
DoAfter(5,"myText")

and had it send to script. but the trigger would not fire. then I put

world.DoAfter(5,"myText")

and the trigger fired.
Australia Forum Administrator #2
In Lua, if that is your scripting language, function arguments have to go inside brackets, with the exception of a single string. For example:


print "hello"

or:

print ("hello")


However for other things, like multiple arguments, you must use brackets, eg.


print (2 + 2)
print (a, b)
print ("foo", "bar")