Page 1 of 1

Teleporter state

Posted: Sun Feb 23, 2020 11:22 pm
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?

Re: Teleporter state

Posted: Mon Feb 24, 2020 1:06 am
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