I’m trying to make a tool giver. I looked at this thread Tool Giver not working but it still doesn’t work
The script:
local tool = game.ServerStorage.Tool
script.Parent.ClickDetector.MouseClick:Connect(function(player)
local give = tool:Clone()
give.Parent = player.Backpack
end)
Have you tried instead moving the tool into replicated storage, and making the code a bit more simple like this.
Local tool = game.ReplicatedStorage.Tool
local tool = game.ServerStorage:WaitForChild("Tool")
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if player then
local give = tool:Clone()
give.Parent = player.Backpack
end
end)
Make sure it is a server script, or it will not work.
local gear = game:GetService("ServerStorage").Tool
script.Parent.MouseButton1Click:Connect(function(click)
local player = game:GetService("Players"):GetPlayerFromCharacter(click.Parent)
if player then
local give = gear:Clone()
give.Parent = player.Backpack
end
end)
Sorry for the indentation. I wrote this on mobile.
If that doesnt work, try put “click” instead of click.Parent as the parameters.