It’s a simple script, wich is why i’m confused, its a simple turn on and off screen tv, but depending on a boolvalue, the screen will show a diffrent decal.
It’s simple, but its not working at all, and i’m not sure what the problem is.
It originally was a proximitypront, with e as the button to hold to turn it on. But it didn’t work, so i tried changing things to work as a clickable button, but still doesn’t work.
local screen = script.Parent.Tela
local button = script.Parent.Botao
local creepy = script.Parent.Creepy --this is a boolvalue.
local turnedon = screen.Ligado -- this is a boolvalue
local cef = screen.Creepyef
local cbi = screen.Creepybi -- this, and the one above is a decal for the screen.
function Ligoutv()
if creepy == false and turnedon.Value == false then
screen.PointLight.Enabled = true
turnedon.Value = true
screen.Decal.Transparency = 0
print("turned on, without scary decal.")
elseif creepy == false and turnedon.Value == true then
screen.PointLight.Enabled = false
turnedon.Value = false
screen.Decal.Transparency = 1
print("turned off.")
elseif creepy == true and turnedon.Value == false then
screen.PointLight.Enabled = true
turnedon.Value = true
cef.Transparency = 0.5
cbi.Transparency = 0.5
print("turned on, but creepy.")
end
end
button.ClickDetector.MouseClick:Connect(Ligoutv())
in the output, it says that its attempting to call a nil value… and thats the error that i’m not sure what i’m supposed to do, pls help.