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

Why does this script not remove a table content?

Asked by
DogeIXX 172
4 years ago
Edited 4 years ago

Hey, I am trying to remove a number value from a table. It is 100% in the table. It also gives no error.

Script with problem:

local DS2 = require(script.Parent.DataStore2)
game.ReplicatedStorage.Delete.OnServerEvent:Connect(function(plr,id)
    local DataStore = DS2("gamelibrary",plr)
    local games = DataStore:Get({game.PlaceId})
    print(id)
        table.remove(games,id)
        DataStore:Set(games)
        game.ReplicatedStorage.Refresh:FireClient(plr,games)
end)

LocalScript that calls the event:

script.Parent.Activated:Connect(function()
    script.Parent.Visible = false
    game.ReplicatedStorage.Delete:FireServer(script.Parent.Parent.GameID.Value)
end)
0
this doesnt look like the entire script, could you include that as well? Benbebop 1049 — 4y
0
It is the whole script, but I could add the local script too. DogeIXX 172 — 4y

Answer this question