So everytime Someone wins, Them Get a point, But i want their point to save, Everytime they join/leave server, Please Help!
local Debounce = tick() -- Assign tick() to the variable
game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("BoolValue", plr)
stats.Name = "leaderstats"
local wins = Instance.new("IntValue", stats)
wins.Name = "Wins"
wins.Value = 0
workspace.Lobby.Winner.Touched:Connect(function()
if (tick() - Debounce) >= 5 then -- Make sure 5 seconds have elapsed since last debounce
Debounce = tick()
wins.Value = wins.Value + 1
end
end)
end)

1 comment
First of all, please check your grammar before posting as it can be very confusing to read someone's posts if it isn't written correctly. Secondly, I think you are trying to find what is called a "DataStore", here is a link to a wiki article about saving player data and most likely will help with what you are trying to accomplish. https://developer.roblox.com/articles/Saving-Player-Data