Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What does Not running script because past shutdown deadline mean?

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

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

playersleft = playersleft + 1

local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local bucks = Instance.new("IntValue")
bucks.Name = "Money"
bucks.Value = 0
bucks.Parent = leaderstats


player.CharacterAdded:Connect(function(character)
	character.Humanoid.WalkSpeed = 16
	character.Humanoid.Died:Connect(function()
		-- Whenever someone dies this happens
		
		if character.Humanoid and character.Humanoid:FindFirstChild("creator") then
			game.ReplicatedStorage.Status.Value = tostring(character.Humanoid.creator.Value).." Killed "..player.Name
		end
		
		if character:FindFirstChild("GameTag") then
			character.GameTag:Destroy()
		end
		
		player:LoadCharacter()
	end)
	
end)

-- Data Store

local player_data

pcall(function()
	player_data = datastore:GetAysnc(player.UserId.."-Money")
end)

if player_data ~= nil then
	--Player has saved data, load it in
	bucks.Value = player_data
else
	-- New player
	bucks.Value = defaultcash
end

end)

local bindableEvent = Instance.new("BindableEvent")

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

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

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

1 comment

0

I think it was because the data wasn't saving in time

1 answer

It was because I misspelled Async in the final pcall.

This discussion is preserved as it was. New answers, comments, and votes are closed.