Page 1 of 1

Script Struggle

Posted: Thu Jan 29, 2015 10:20 am
by moonax
Hi,

This my first time giving modding a go. I have a script for the activation of a teleport when an item is put in an alcove. I used a similar script elsewhere to open a gate, but some isn't working for this. Any help? Thanks.

Here's the Script

function checkItems(alcove)

if alcove.contents("blue_gem")
then teleporter_3:activate()
else
teleporter_3:deactivate()
end
end

Re: Script Struggle

Posted: Thu Jan 29, 2015 4:17 pm
by maneus
Try this:

Code: Select all

for i in nameofyouralcove:containedItems() do
		if i.name == "blue_gem" then
		   teleporter_3:activate()
			else
			teleporter_3:deactivate()
			end
			end
			end
Connect your alcove with this script on event "any".

Re: Script Struggle

Posted: Fri Jan 30, 2015 6:07 am
by moonax
Thanks maneus. I tried your script but it says "attempt to call method 'containedItems' (a nil value). [Note: this is for LOG 2].

Re: Script Struggle

Posted: Fri Jan 30, 2015 6:58 am
by maneus
If your future questions are for Grimrock 2 then please post your questions in the modding section of the forum for Grimrock 2. ;)