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

My Script wont work with filtering enabled?

Asked by 6 years ago

this script works find without filtering enable but i need that on, this script is to save leaderstats i need help please.


function onPlayerEntered(player) wait()-- player:WaitForDataReady() repeat wait() until player:FindFirstChild("leaderstats") if player.DataReady then if player:findFirstChild("leaderstats") then local score = player.leaderstats:GetChildren() for i = 1,#score do local ScoreLoaded = player:LoadNumber(score[i].Name) wait() if ScoreLoaded ~= 0 then score[i].Value = ScoreLoaded end end end end end function onPlayerLeaving(player) if player:findFirstChild("leaderstats") then local score = player.leaderstats:GetChildren() for i = 1,#score do player:SaveNumber(score[i].Name,score[i].Value) end end end game.Players.PlayerAdded:connect(onPlayerEntered) game.Players.PlayerRemoving:connect(onPlayerLeaving)

1 answer

Log in to vote
0
Answered by 6 years ago

The method ':SaveNumber' is deprecated, you're going to have to use 'DataStoreService'.

Ad

Answer this question