My Script wont work with filtering enabled?
this script works find without filtering enable but i need that on, this script is to save leaderstats
i need help please.
01 | function onPlayerEntered(player) |
03 | player:WaitForDataReady() |
04 | repeat wait() until player:FindFirstChild( "leaderstats" ) |
05 | if player.DataReady then |
06 | if player:findFirstChild( "leaderstats" ) then |
07 | local score = player.leaderstats:GetChildren() |
09 | local ScoreLoaded = player:LoadNumber(score [ i ] .Name) |
11 | if ScoreLoaded ~ = 0 then |
12 | score [ i ] .Value = ScoreLoaded |
19 | function onPlayerLeaving(player) |
20 | if player:findFirstChild( "leaderstats" ) then |
21 | local score = player.leaderstats:GetChildren() |
23 | player:SaveNumber(score [ i ] .Name,score [ i ] .Value) |
28 | game.Players.PlayerAdded:connect(onPlayerEntered) |
29 | game.Players.PlayerRemoving:connect(onPlayerLeaving) |