So i've been trying to get this script to change the decal on a T.V. I made's screen from black to a different decal. on the screen I've already got a decal, which is the black screen. On the power button I've got a click detector linked to a function in my script. My problem is that it wont work.
Here is the code:
local isOn = true
function on()
script.Parent.Parent.screen.ison.Texture = rbxassetid://1400090149
isOn = true
end
function off()
Parent.screen.ison.Texture = rbxassetid://2675785344
isOn = false
end
function onclicked()
if isOn = true then off() else on() end
end
script.Parent.ClickDetector.MouseClick:Connect(onclicked)
Here is a pic of my studio if it helps: https://ibb.co/PYW3NbG
It might not show it here, but in my original, it displays a red line under the first dash in rbxassetid://1400090149. Why is this happening and how do I fix it?

1 comment
Thanks!