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

How can I change this text's text?

I have made a game and whenever you click the ring, the quest should change, but nothing happened but the ring got destroyed (which means the script isn't wrong). Is it just a bug or did I do something wrong?

script:

script.Parent.MouseClick:Connect(function(click)
	game.StarterGui.ScreenGui.Frame.QuestInfo.Text = "return the ring"
	script.Parent.Parent.Parent:Destroy()
	
end)

4 comments

0

Use a LocalScript and get the gui in the player's PlayerGui. https://developer.roblox.com/en-us/api-reference/class/PlayerGui

0

How can I get the gui in the player's PlayerGui?

0

I seriously sent you a link... Get the LocalPlayer and then the PlayerGui is a child of the player

0

Hi, are you using a localscript or serverscript?

2 answers

✓ Accepted answer

Hi. In the line ' game.StarterGui.ScreenGui.Frame.QuestInfo.Text = "return the ring" ', the QuestInfo belongs to the StarterGui, not the player's gui, you should do this instead:

script.Parent.MouseClick:Connect(function(Player) -- It's the player that clicked
	Player.PlayerGui.ScreenGui.Frame.QuestInfo.Text = "return the ring"
	script.Parent.Parent.Parent:Destroy()
end)

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