Try cloning the tool out of replicated storage Also, Do you want it to give it to the player right away? If you clone it to starter pack they will have to reset. If you want them to have it right away then you should clone it to player.Backpack
I do not understand why you are using :GetChildren() when that would return a table instead of a singular instance, I normally don’t spoonfeed code but I will do it this time to help you out and explain to you what you did wrong.
Client:
local BUTTON = script.Parent
local RE = game.ReplicatedStorage.Folder:WaitForChild(“RemoteEvent”)
BUTTON.MouseButton1Down:Connect(function(player)
print(“button was clicked”)
RE:FireServer()
end)
Server:
local tool = game.ReplicatedStorage.Folder:WaitForChild(“Tool”)
local RE = game.ReplicatedStorage.Folder:WaitForChild(“RemoteEvent”)
game.Players.PlayerAdded:Connect(function(player)
RE.OnServerEvent:Connect(function()
tool:clone().Parent = player.Backpack — clones the tool and puts in the player’s backpack
end)
end)
Make sure you use the client to detect the button was clicked and make the server do the legwork(clone the tool).
Its best if you place tools in ReplicatedStorage, which is easily accessible for both Server and Client. I dont really get why some people place their tools in Lighting. ReplicatedStorage is the proper service you place tools and other objects in.
does not matter where it’s stored as long as it can be accessed from both the client or server, most people use ReplicatedStorage (myself included) but lighting will work just fine so it does not matter.