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

How fix this maybe outdated script that does not work anymore?

I don't know what happened but the scrip stopped working, please help, and if you are wondering how I don't know to fix it, I am a starting coder.

local severStorage = game:GetService("ServerStorage")
local DataStore = game:GetService("DataStoreService"):GetDataStore("PlayerSave3")
--------------Stats--------------
game.Players.PlayerAdded:Connect(function(player)
	--------------leaderstats and dataFolder--------------
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player
	
	local dataFolder = Instance.new("Folder")
	dataFolder.Name = player.Name
	dataFolder.Parent = severStorage.RemoteData
	--------------DeathStats--------------
	local deaths = Instance.new("StringValue")
	deaths.Name = "Deaths"
	deaths.Value = DataStore:GetAsync(player.UserId).Deaths or "0"
	deaths.Parent = leaderstats
	
	player.CharacterAdded:Connect(function(char)
		local humanoid = char:FindFirstChild("Humanoid")
		humanoid.Died:Connect(function()
			wait(0.001)
			deaths.Value = deaths.Value + 1
		end)
	end)
	--------------TotalTimeStats--------------
	local TotalTime = Instance.new("StringValue")
	TotalTime.Name = "TotalTime"
	TotalTime.Parent = leaderstats
	TotalTime.Value = DataStore:GetAsync(player.UserId).TotalTime or "0"
	
	while true do 
		wait(1)
		TotalTime.Value = TotalTime.Value +1
	end
end)

2 comments

0

is there any errors?

0

no

1 answer

✓ Accepted answer

Are you getting any errors? try using print() functions to figure out how far through the script its getting before it fails. Also, make sure in studio on the home tab -> Game Settings -> Options -> Allow HTTP Requests and Enable Studio Access to API Services are both turned on :)

2 comments

0

no errors

0

OMG THANK YOU

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