Hi,
I'm having trouble with a script that says it returns a nil value and I'm not sure why. Similar scripts have worked elsewhere. Any ideas?
function checkItems(alcove)
if alcove.contents("rock")
then teleporter_3:activate()
else
teleporter_3:deactivate()
end
end
Thanks!
Help with a Script, Please
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: Help with a Script, Please
I think you need to define what part of the teleporter you are activating, that is the nil value you are getting.
Code: Select all
function checkItems(alcove)
if alcove.contents("rock")
then teleporter_3.controller:activate()
else
teleporter_3.controller:deactivate()
end
end
Re: Help with a Script, Please
Thanks for the reply Skuggasveinn.
How would I define the part of the teleporter I'm using. I've set a target, and I'm not using spin. Is there something more?
Sorry, I'm new to scripting and modding.
How would I define the part of the teleporter I'm using. I've set a target, and I'm not using spin. Is there something more?
Sorry, I'm new to scripting and modding.
Re: Help with a Script, Please
Look at Skuggs code. It has
"then teleporter_3.controller:activate()"
that's the "part"
"then teleporter_3.controller:activate()"
that's the "part"
Currently conspiring with many modders on the "Legends of the Northern Realms"project.
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Re: Help with a Script, Please
Ah, thanks. For some reason I missed seeing that bit. That works!
Thank you very much! [Sorry for my blindness]
Thank you very much! [Sorry for my blindness]