Page 1 of 1

Help with a Script, Please

Posted: Fri Jan 30, 2015 10:29 am
by moonax
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!

Re: Help with a Script, Please

Posted: Fri Jan 30, 2015 4:58 pm
by Skuggasveinn
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

Posted: Fri Jan 30, 2015 11:31 pm
by moonax
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.

Re: Help with a Script, Please

Posted: Fri Jan 30, 2015 11:49 pm
by msyblade
Look at Skuggs code. It has

"then teleporter_3.controller:activate()"

that's the "part"

Re: Help with a Script, Please

Posted: Sat Jan 31, 2015 1:38 am
by moonax
Ah, thanks. For some reason I missed seeing that bit. That works!

Thank you very much! [Sorry for my blindness]