Teleporter state

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
RayB
Posts: 140
Joined: Fri Mar 06, 2015 3:45 am

Teleporter state

Post by RayB »

I have been trying to get information through script about the state of a teleporter. Specifically if it is activated or deactivated.
Can anyone help me with a script statement that will return the state of a teleporter?
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Teleporter state

Post by minmay »

The Component:isEnabled() method returns true if the Component is enabled and false if it is not, so:

Code: Select all

if teleporter_26.teleporter:isEnabled() then
	-- teleporter is activated
else
	-- teleporter is deactivated
end
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply