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

How do I change text of a button by the player selecting a tool?

i'm making a inventory gui whenever you select the item it changes the name of a textlabel in the inventory gui

1 answer

There, just set the paths.

tool.Selected:connect(function()
	textlabel.Text = "string"
end)

You may use Selected or Equipped event.

A hint: if it's a HopperBin, its parent.parent is the player, where you can find PlayerGui. If it is a Tool, when selected it will go to Character, then you may use GetPlayerFromCharacter method.

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