Jump to content

Recommended Posts

Posted

Hello, when creating my project I've realized that it was possible to change the color of a light via the editor, is there a way to change or draws a switch activated on / off light.

In my example it is for doors that changes from red to green.

Posted

Here we go:

 

tzgw8qM.png

 


Script.enabled = true --bool "Enabled"

Script.on = true --bool "Start on"

Script.coloron = Vec3(255,255,255) --color "Color On"

Script.coloroff = Vec3(0,0,0) --color "Color Off"

 

 

function Script:Start()

if self.on == true then

self:On()

else

self:Off()

end

end

 

 

function Script:On() -- in

self.entity:SetColor(self.coloron.x,self.coloron.y,self.coloron.z,255)

self.component:CallOutputs("On")

end

 

function Script:Off() --in

self.entity:SetColor(self.coloroff.x,self.coloroff.y,self.coloroff.z,255)

self.component:CallOutputs("Off")

end

 

 

function Script:Enable()--in

if self.enabled==false then

self.enabled=true

self.component:CallOutputs("Enable")

self.entity:Show()

end

end

 

function Script:Disable()--in

if self.enabled then

self.enabled=false

self.component:CallOutputs("Disable")

self.entity:Hide()

end

end

Posted

Basically I create doors that only open a half-and therefore to spend must be kneeling or code fpsplayer.lua code is not contien

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...