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

once does not print the table, connect does but only after firing twice, what is the solution?

Asked by 1 year ago
Edited 1 year ago

script:

local remoteEvent = ReplicatedStorage.insert.OnServerEvent:Once(function(player, id)
    newt = player.Character.Humanoid:GetAppliedDescription()
    bp = game.MarketplaceService:GetProductInfo(id)
    bpt = bp.AssetTypeId
    yolo = {AssetId = id, AccessoryType = Enum.AccessoryType[humData[bpt]] }
    local allaccs = {}
    print(player.Character.Humanoid:GetAppliedDescription():GetAccessories(true))
    table.insert(allaccs, newt:GetAccessories(true))
    table.insert(allaccs, yolo)
print(allaccs)

allacc doesnt print when I do OnServerEvent:Once but it does print when I do OnServerEvent:Connect, but only after firing the event twice...

Answer this question