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

BindToClose Isnt Working. i tried everything but nothing worked pls help?

Asked by
VAnkata20 135
3 years ago

The Bind To Close Function Is not working For Some Reason

01game:BindToClose(function()
02    local RunService = game:GetService("RunService")
03    if RunService:IsStudio() then
04        print("HAHA STUDIO")
05        return
06    end
07 
08    local Players = game:GetService("Players")
09    for _, player in pairs(Players:GetPlayers()) do
10        local Stats = player.LevelingSystem:GetChildren()
11        local datastore = game:GetService("DataStoreService"):GetDataStore(player.UserId.."Stats")
12        local statstorage = player:FindFirstChild("LevelingSystem"):GetChildren()
13            local success , err = pcall(function()
14            datastore:SetAsync("Lvl",statstorage.Lvl.Value)
15            print("stat number 1 has been changed")
View all 45 lines...
0
Are you trying this inside Studio? Soban06 410 — 3y
0
No VAnkata20 135 — 3y

Answer this question