Experimenting this time with multiple instances like 'Beam', 'SurfaceGUI', 'TextLabels', and 'PointLight'. Code below works properly, just not sure how to go about using the 'for' loop making it so that each activation (or deactivation) makes the instances fade in or out.
--Setting some variables here and should be alphabetical-- surface = script.Parent.Parent.Surface root = script.Parent.Parent base = script.Parent light = root.Emitter.p1 text0 = surface.G0.T0 text1 = surface.G1.T1 b0 = root.Emitter.b0 b1 = root.Emitter.b1 --Add a debounce here plus some extras-- local isOn = false local debounce = false -- For later use... --All the fancy stuff down here-- function holo() if isOn == false then print("Turning on...") wait(2) isOn = true b0.Enabled = true -- All '.enable' lines self-explanatory, open to future optimization light.Enabled = true b1.Enabled = true text0.TextStrokeTransparency = 0 text0.TextTransparency = 0.3 text1.TextStrokeTransparency = 0 text1.TextTransparency = 0.3 elseif isOn == true then print("Already on, turning off...") wait(3.5) isOn = false b0.Enabled = false -- All '.enable' lines self-explanatory, open to future optimization light.Enabled = false b1.Enabled = false text0.TextStrokeTransparency = 1 text0.TextTransparency = 1 text1.TextStrokeTransparency = 1 text1.TextTransparency = 1 print("Off") end end script.Parent.ClickDetector.MouseClick:connect(holo)
Here’s a simple loop that should work changing the .Brightness from dim to bright. Its just a for loop where “i” represents the brightness of the part. The 0 is the min brightness and 5 is the max. It is set to increase and decrease from 0-5 and 5-0 in increments of .1. Obviously you can change these values depending on what effect you're trying to achieve. Hope it’s helpful!
local light = script.Parent -- if it’s in the part while true do for i = 0,5,0.1 do light.Brightness = i wait(1) end for i = 5,0,-0.1 do --This should be a neg num telling the loop that it is decreasing i. light.Brightness = i wait(1) end end