Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

TextLabel isn't a valid member of ScreenGui?

When I tried to run a code that makes a little window pop up when you equip an item, the output said: "TextLabel is not a valid member of ScreenGui". I am confused.

local sword = game.Workspace.ClassicSword

sword.Equipped:Connect(function(eqp)
	script.Parent.ScreenGui.TextLabel.BackgroundTransparency = 0
	script.Parent.ScreenGui.TextLabel.TextTransparency = 0
	script.Parent.ScreenGui.TextLabel.Text = "This is incredible!"
	script.Parent.Ding:Play()
	wait(6)
	script.Parent.ScreenGui.TextLabel.Text = "It seems you have found an artifact from this planet."
	script.Parent.Ding:Play()
	wait(6)
	script.Parent.ScreenGui.TextLabel.Text = "It is an ancient sword."
	script.Parent.Ding:Play()
	wait(6)
	script.Parent.ScreenGui.TextLabel.Text = "The sword may be useful later on."
	script.Parent.Ding:Play()
	wait(6)
	script.Parent.ScreenGui.TextLabel.BackgroundTransparency = 1
	script.Parent.ScreenGui.TextLabel.TextTransparency = 1
end)

1 comment

0

Hold on buddy, one question: "Where is this script located?" Is there an instance called ScreenGui inside script.Parent or is script.Parent the ScreenGui?

1 answer

✓ Accepted answer

Is TextLabel an Object located in ScreenGui or are you trying to change the text of something? If so, make sure it's on the TextLabel (or whatever) then do .TextLabel.

This discussion is preserved as it was. New answers, comments, and votes are closed.