Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

What wrong with this script?

Asked by 10 years ago
Workspace.PIDS.PIDS.TextLabel.Text = "A"
Wait(5)
Workspace.PIDS.PIDS.TextLabel.Text = "B"
Wait(5)
Workspace.PIDS.PIDS.TextLabel.Text = "C"
Wait(5)
Workspace.PIDS.PIDS.TextLabel.Text = "D"
Wait(5)

Workspace>PIDS(Part)>PIDS(SurfaceGui)>Frame>TextLabel

l need a fix script

Wrong : TextLabel is not a valid member of SurfaceGui

2 answers

Log in to vote
1
Answered by
hiccup111 231 Moderation Voter
10 years ago

You forgot to add 'Frame' in your path,

Workspace.PIDS.PIDS.Frame.TextLabel.Text = "A"
Wait(5)
Workspace.PIDS.PIDS.Frame.TextLabel.Text = "B"
Wait(5)
Workspace.PIDS.PIDS.Frame.TextLabel.Text = "C"
Wait(5)
Workspace.PIDS.PIDS.Frame.TextLabel.Text = "D"
Wait(5)


Ad
Log in to vote
2
Answered by 10 years ago

The #1 error I can see are the Waits. Remember, lua is cap-sensitive, so you have to type it accordingly to how it works, so what you have to do is Lowercase the Waits, and #2, try changing both names of PIDS to something else other then them both having the same name, if that doesn't work then try this;

if game:FindService("Workspace")and game.Workspace:FindFirstChild("PIDS")and game.Workspace.PIDS:FindFirstChild("OTHER NAME HERE")and game.Workspace.Pids.OTHER NAME HERE:FindFirstChild("Frame")and game.Workspace.PIDS.OTHER NAME HERE.Frame:FindFirstChild("TextLabel")then
game.Workspace.PIDS.OTHER NAME HERE.TextLabel.Text = "A"
wait(5)
game.Workspace.PIDS.OTHER NAME HERE.TextLabel.Text = "B"
wait(5)
game.Workspace.PIDS.OTHER NAME HERE.TextLabel.Text = "C"
wait(5)
game.Workspace.PIDS.OTHER NAME HERE.TextLabel.Text = "D"
wait(5)
end

Last but not least, the script thinks TextLabel is within SurfaceGui, so it went there, and when the script didn't see it as existant, it gave you an error because TextLabel, as you typed it, is Parented into the Frame within SurfaceGui. Hope this helped!

0
Tested,failed(PIDS is not a valid member of Part)(othre name=Gui=PIDS(SurfaceGui)) 7785543 2 — 10y

Answer this question