lxFirebal69xl Posted February 15, 2015 Share Posted February 15, 2015 So I was messing around with a level, and I can't figure out what function I should use to make a light go off. Hide() and Stop() don't seem to work. Any help? Quote Link to comment Share on other sites More sharing options...
beo6 Posted February 15, 2015 Share Posted February 15, 2015 Hide should work. What is your code? //Edit: here is a short script. Works without any problem. Just connect it in your flowgraph with the default PushButton.lua script. -- activate light function Script:Activate()--in if self.entity:Hidden() then self.entity:Show() self.component:CallOutputs("Activate") end end -- deactivate light function Script:Deactivate()--in if not self.entity:Hidden() then self.entity:Hide() self.component:CallOutputs("Deactivate") end end -- toggle light function Script:Toggle()--in if not self.entity:Hidden() then self:Deactivate() else self:Activate() end end Quote Link to comment Share on other sites More sharing options...
lxFirebal69xl Posted February 16, 2015 Author Share Posted February 16, 2015 That worked thank you, I have no idea what I was doing wrong. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.