This script only gives a tool when a player touches it ,but i want everyone to get the tool help?
function onTouched(fish) local player = game.Players:playerFromCharacter(fish.Parent) local h = fish.Parent:findFirstChild("Humanoid") if h~=nil then if player ~= nil then game.Lighting.Hammer:Clone().Parent = player:FindFirstChild("Backpack") script.Parent:remove() end end end script.Parent.Touched:connect(onTouched)
Line 2: PlayerFromCharacter()
is not correct.
Correct:
local player = game.Players:GetPlayerFromCharacter(fish.Parent)
And by the way, you don't need the humanoid check, because if 'player' checks out, it is guaranteed to have a humanoid.