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

Group Item Not Loading For Some Players?

Asked by
D3VRO 66
5 years ago

Players have been giving reports on bugs like their omega drink (group item). They've said that it doesn't show up in their inventory once they rejoin the game after joining the group. And for some players, they've told me that it's in their inventory. I'd just like an explanation and solution as to why it doesn't load for some players.

local item = game.ReplicatedStorage.Items:FindFirstChild("omega energy drink")
game.Players.PlayerAdded:Connect(function(plr)
    if plr:IsInGroup(4292399) then
        local bag = plr:WaitForChild("Backpack")
        item:Clone().Parent = bag
        item:Clone().Parent = plr.StarterGear
    end
end)
0
Im just guessing here but, have you tried adding a delay before checking the group? Maybe just wait a few seconds. DinozCreates 1070 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Not 100% sure, but I think :IsInGroup() doesn’t return up-to-date results. If the player joins the group and immediately joins the game after that, it won’t work as the function still thinks the player isn’t in the group. Maybe give it a few minutes or at most half an hour and it should work.

If you want it to be up-to-date sooner though, I read on the Roblox wiki that using a localscript gives you more up-to-date results.

Hope this helped!

0
Thank you, it did. D3VRO 66 — 5y
Ad

Answer this question