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

My Surface Gui button doesn't work . What do i do?

When I click The Button on The surface gui it doesn't give me the key. If you would like to see a video please let me know. (Also does anyone have an idea on how to make the text change to the persons name when clicked and reset if the player leaves the game and if the players already has a key it doesn't clone more into the player's backpack when pressed)

local p = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
 local tool = game.Lighting.Key:Clone()
 tool.Parent = p.Backpack
end)

5 comments

0

can i have the error it gives or does it not give any error?

0

No errors given

0

You linked me to the wiki but there's nothing there that helps

0

Sorry. qq I forgot to note that it states: "However, ServerStorage and ReplicatedStorage should now be used for this purpose instead." in the page.

1 answer

✓ Accepted answer

So first, you want to put the surfacegui in StarterGui, and set the Adornee to the part that you want the SurfaceGui to be on, then it should work!

1 comment

0

thanks that worked, do you mind if i ask another question

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