local tool = game.StarterPack.Tool
tool.Equipped:Connect(function()
script.Parent.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
local p = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = p:FindFirstChild("leaderstats").Water
if hum and p and stats then
stats.Value = stats.Value + 1
end
end)
tool.Unequipped:Connect(function()
script.Parent.Touched:Connect(function(hit)
local hum = hit.ParentFindFirstChild
if hum then
wait()
end
end)
end)
end)
this is a server script parented to a part it's supposed to add 1 to the "Water" value whenever the part is touched while a certain tool is equipped i don't get it what am i doing wrong

6 comments
on line 13 you missed a colon and parentheses.that might be the issue
on line 13 you missed a colon and parentheses.that might be the issue
nope that isn't the issue
does it output any error? If so, what is the error?
there's no error
See, the problem here is your are doing game.StarterPack with a server script. When using StarterPack or anything player related, you are supposed to use a local script and connect the 2 using remote events.