#why doesnt this script work?
19 messages · Page 1 of 1 (latest)
local clickDetector = script.Parent
local fact = game.StarterGui.ScreenGui:FindFirstChild("fact1")
fact.TextTransparency = 1
function onClicked(player)
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "You realize that each light in your house takes up about 100 watts, right?"
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "If you don't know how much that is, all I can say is it is a lot."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "So, it is probably better that light stays off."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "But some times it is okay if you need to turn your lights on, like when it is dark and you need to see."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "We can also save energy by using more renewable sources of energy, like solar energy."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "Maybe you can make a light which automatically turns on when it detects motion."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "Head on up to the next floor."
fact.TextTransparency = 0
wait(5)
while true do
fact.TextTransparency = fact.TextTransparency - 1
wait(0.4)
end
end
clickDetector.MouseClick:Connect(onClicked)
its playergui
not startergui
do Player.PlayerGui
local fact = game.Players.LocalPlayer.PlayerGui.ScreenGui.fact1
im assuming its a local script
oh, ok
** You are now Level 2! **
what if its just a script?
then u have to get the playerusing click detector
local clickDetector = script.Parent
function onClicked(player)
local fact = player.PlayerGui:FindFirstChild("fact1")
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "You realize that each light in your house takes up about 100 watts, right?"
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "If you don't know how much that is, all I can say is it is a lot."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "So, it is probably better that light stays off."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "But some times it is okay if you need to turn your lights on, like when it is dark and you need to see."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "We can also save energy by using more renewable sources of energy, like solar energy."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "Maybe you can make a light which automatically turns on when it detects motion."
fact.TextTransparency = 0
wait(5)
fact.TextTransparency = 1
fact.Text = "Head on up to the next floor."
fact.TextTransparency = 0
wait(5)
while true do
fact.TextTransparency = fact.TextTransparency - 1
wait(0.4)
end
end
clickDetector.MouseClick:Connect(onClicked)
btw
DIE
WRAHRAHRAHRAHRAHRA
thx
s -4 code
its not mine
