I have a point giving script and what would be the correct script to add to this so that when a player leaves and rejoins, the points that are given from this part are still there. Currently, when you leave, you will lose all of the points that you got from this part. How would I make the points not go away?
local ting = 0
function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")
if stats ~= nil then
local cash = stats:findFirstChild("Points")
cash.Value = cash.Value +5
wait(0.1)
end
end
ting = 0
end
end
script.Parent.Touched:connect(onTouched)
