Hello. I've recently been working on a data store system, which adds a permanent value to a player who steps on a piece. However, I want the player to get points after a timer is finished, instead of stepping on a piece. I've tried making a local script for increasing the players value, but it doesn't work in a local script because the data doesn't permanently save. And when I try to do it in a normal script it gives every person 1 point instead of just giving it to 1 person, but permanently stores it. What could I do in a normal script to give a local player 1 point if the timer ends?
(Btw this is the script I used for the points of a player to go up if they step on a part)
local ting = 0
function onTouched(hit)
if ting == 0 then --debounce check
ting = 1 --activate debounce
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 --If moneyholder exists then
local cash = stats:findFirstChild("Money")
cash.Value = cash.Value +1000
wait(100)
end
end
ting = 0
end
end
script.Parent.Touched:connect(onTouched)
