Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
local TeleportService = game:GetService("TeleportService") local dVersion = 1 local SaveWins = game:GetService("DataStoreService"):GetOrderedDataStore("Wins", dVersion) game.Players.PlayerAdded:Connect(function(player) local previousData = SaveWins:GetAsync(player.UserId) local Wins if previousData ~= nil then Wins = previousData else Wins = 0 SaveWins:SetAsync(player.UserId, 0) end local WinsValue = Instance.new("NumberValue", player) WinsValue.Name = "Wins" WinsValue.Value = Wins end) game:BindToClose(function() for i, player in pairs(game.Players:GetPlayers()) do local Value = player.Wins.Value SaveWins:SetAsync(player.UserId, Value) end end) game.Players.PlayerRemoving:Connect(function(player) local Value = player.Wins.Value if Value ~= nil then print("Found data to save for "..player.Name.."!") SaveWins:SetAsync(player.UserId, Value) print("Saved data for "..player.Name) else print("Did not manage to find data to save for "..player.Name.."!") end end)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)