wait(3)
print("Script is now running, Saving Data...")
local DSService = game:GetService("DataStoreService"):GetDataStore("EmoteSimCashData")
game.Players.PlayerAdded:Connect(function(plr)
local playerId = "id-"..plr.UserId
local DataToSave = plr.PlayerGui.Amount.Frame.Balance
local GetSaved = DSService:GetAsync(playerId)
if GetSaved then
DataToSave.Value = GetSaved[1]
else
local NumbersForSaving = {DataToSave.Value}
DSService:SetAsync(playerId,NumbersForSaving)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local playerId = "id-"..plr.UserId
local Savetable = {plr.DataToSave.Value}
DSService:SetAsync(playerId,Savetable)
end)
I want to know why this script is only running in Solo Studio, and not In-game. Any Idea why?
Thanks in advance.
