Hello guys. Please help me, I am really new to scipting and I can't figure how to do it. I would like to make a reward system (which I made) and count coins. you start at 0 and when you do a parkour you get reward. For example you touch the part and you teleport (which I could get to work) and then you get +10 points. My points are called Tree Tokens on the leaderboard and here is the teleport script I would like to import the coin add script into:
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent.Head.CFrame = CFrame.new(-58.5, 6.55, -63.5) end end)
I used this to make the leaderstats:
local datastore = game:GetService("DataStoreService") local ds1 = datastore:GetDataStore("CompleteSaveSystem") local ds2 = datastore:GetDataStore("TTSaveSystem") game.Players.PlayerAdded:connect(function(plr) local folder = Instance.new("Folder", plr) folder.Name = "leaderstats" local Complete = Instance.new("IntValue", folder) Complete.Name = "Completes" local TT = Instance.new("IntValue", folder) TT.Name = "Tree Tokens" Complete.Value = ds1:GetAsync(plr.UserId) or 0 ds1:SetAsync(plr.UserId, Complete.Value) TT.Value = ds2:GetAsync(plr.UserId) or 0 ds2:SetAsync(plr.UserId, TT.Value) Complete.Changed:connect(function() ds1:SetAsync(plr.UserId, Complete.Value) end) TT.Changed:connect(function() ds2:SetAsync(plr.UserId, TT.Value) end) end)