Tool spawn GUI Scripting Help

I’m trying to make a tool spawn GUI. I Don’t know how to make it so when you click a tool it gives it to you and the tool works (i found this script in the devforum but it doesn’t really seem to work.)

script.Parent.MouseButton1Down:Connect(function()
local item = game.ReplicatedStorage:WaitForChild(“Sword”)
local db = true
local plr = game.Players.LocalPlayer
item:Clone().Parent = plr.Backpack
end)

if someone could help me that would be awesome.

You need to use RemoteEvents to communicate with the server to clone the tool into your backpack.

1 Like