I'm trying to make it so that when the player clicks on the button "Mug" it gives them a mug and changes the text to blank.~~~~~~~~~~~~~~~~~
local txt = script.Parent.Text local mug = game.ReplicatedStorage.Mug local button = script.Parent button.MouseButton1Click:Connect(function() mug.Parent = game.Players.LocalPlayer.Backpack txt = "ToolName" end)
~~~~~~~~~~~~~~~~~
Are you trying to give the mug to the player via that local script? That won't work. You would need use Remote Events to fire an event to a Server Script so they can handle the rest. You can change the text of the button on the local script though.
You can read more about Remote Events here: https://developer.roblox.com/en-us/api-reference/class/RemoteEvent