Data Wiping GUI

How can I make a data wipe GUI. When player clicks the button and confirms every stat goes to 0 and saves. Any help?
My leaderstats are wins and points.

1 Like

You have to work with Remote Events so:

Local script:
script.Parent.MouseButton1Click:connect(function()
game.ReplicatedStorage.Events.ClearStats:FireServer()
end)

Script:
game.ReplicatedStorage.Events.ClearStats.OnServerEvent:connect(function(plr)
for _, stats in pairs(plr.leaderstats:GetChildren()) do
stats.Value = 0
end
end)

4 Likes

You can send a remote to the server so when you do you can delete both data’s using RemoveAsync()