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

I am trying to make a point system but it wont load the amount. Did I do anything wrong? [closed]

Asked by 4 years ago
local DataStore = game:GetService("DataStoreService")
local PointsData = DataStore:GetDataStore("PointsData")

game.Players.PlayerAdded:Connect(function(plr)
    local Points = Instance.new("NumberValue",plr)
    Points.Name = "Points"
    local Data

    local success, message = pcall(function()
        Data = PointsData:GcetAsync(plr.UserId.."-Points")
        plr.Points.Value = Data
    end)

    if success then
        print("Success")
    else
        warn("Error Whilst loading. Error message: "..message)
    end
end)

game.Players.PlayerRemoving:Connect(function(plr)
    local success, message = pcall(function()
        PointsData:SetAsync(plr.UserId.."-Points", plr.Points.Value)
    end)


    if success then
        print("Success")
    else
        warn("Error Whilst saving. Error message: "..message)
    end
end)
0
Yes, you put gcetAsync instead of getasync. KamKam_AJHasBeenBan 37 — 4y
0
10th line. you've been put GcetAsync instead GetAsync. TheEagle722 170 — 4y

Closed as Not Constructive by JesseSong

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?