Jump to content
xana

light setting

Recommended Posts

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.

Share this post


Link to post

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

Share this post


Link to post

I know I ask of you too but you do not have a code for bedtime lowers or character?

Share this post


Link to post

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

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...