Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What does Not running script because past shutdown deadline mean?

Asked by 5 years ago

local datastore = game:GetService("DataStoreService"):GetDataStore("MoneyDataStore") local defaultcash = 0 local playersleft = 0

game.Players.PlayerAdded:Connect(function(player)

01playersleft = playersleft + 1
02 
03local leaderstats = Instance.new("Folder")
04leaderstats.Name = "leaderstats"
05leaderstats.Parent = player
06 
07local bucks = Instance.new("IntValue")
08bucks.Name = "Money"
09bucks.Value = 0
10bucks.Parent = leaderstats
11 
12 
13player.CharacterAdded:Connect(function(character)
14    character.Humanoid.WalkSpeed = 16
15    character.Humanoid.Died:Connect(function()
View all 45 lines...

end)

local bindableEvent = Instance.new("BindableEvent")

game.Players.PlayerRemoving:Connect(function(player)

1pcall(function()
2    datastore:SetAsync(player.UserId.."-Money",player.leaderstats.Money.Value)
3    print("Saved")
4    playersleft = playersleft - 1
5    bindableEvent:Fire()
6end)

end)

game:BindToClose(function() -- This will be triggerd upon shutdown while playersleft > 0 do bindableEvent.Event:Wait() end end)

My script is saying: Not running script because past shutdown deadline

0
I think it was because the data wasn't saving in time tyorange09 4 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

It was because I misspelled Async in the final pcall.

Ad

Answer this question