So this was a revision for my other question I answered, but basically how can I obtain player points through a tool that I have equipped? Here are the two scripts.
--this is where the tool will hit.
local debounce = false
script.Parent.Touched:connect(function(hit)
if not debounce then
debounce = true
local look = hit.Parent:findFirstChild("BallHandler").Value
local found = game.Players:findFirstChild(look)
local cash = found:findFirstChild("leaderstats")
cash['Shots Made'].Value = cash['Shots Made'].Value+1
print("Gave +1 SM")
wait(1)
debounce = false
end
end)
--this is what "BallHandler" is.
while wait() do
plr=game.Players:FindFirstChild(script.Parent.Parent.Parent.Name)
if plr then
script.Parent.Value=plr.Name
end
end
How would I make it so that I would get 1 Player Point whenever I touched that part with the tool I'm using?
Thanks, LukeGabrieI
