Techno0ne posted this one to but it still did not work for me can someone please help? This is the win giver script.
amnt = 1 --how much you get for it
return function(winner)
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if (h~=nil) then
local thisplr = game.Players:findFirstChild(h.Parent.Name)
if (thisplr~=nil) then
local stats = thisplr:findFirstChild("leaderstats")
if (stats~=nil) then
local score = stats:findFirstChild("Wins")
if (score~=nil) then
score.Value = score.Value + amnt
end
end
end
end
end
end
This is the leader board.
local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("WinsSaveSystem")
game.Players.PlayerAdded:connect(function(plr)
local folder = Instance.new("Folder", plr)
folder.Name = "leaderstats"
local wins = Instance.new("IntValue", folder)
wins.Name = "Wins"
wins.Value = ds1:GetAsync(plr.UserId) or 0
ds1:SetAsync(plr.UserId, wins.Value)
wins.Changed:connect(function()
ds1:SetAsync(plr.UserId, wins.Value)
end)
end)
If anyone knows please help! Look at the game if you want to see what I'm talking about. https://web.roblox.com/games/5270154521/ALTERCATION-ALPHA?refPageId=098a8aa0-0382-4f17-b668-a9edbd92c5af

4 comments
were do I put this?
Ok I will try it out.
I did not work
never mind it did