Hello. I was making a script to set a GUI box but this error is appearing when I run it: 'Line 13, attempt to index nil with Handle'. Here is my Script:
local administrators = {
698511703
}
local WaitTime = 5
local imageList = game.ReplicatedStorage.Permit_Images
game.Players.PlayerAdded:Connect(function(plr)
for i, v in pairs(administrators) do
if plr.userId == v then
local bp = plr.Backpack
local permit = bp:WaitForChild('Permit', WaitTime)
local frame = permit.Handle.PermitGui
local image = imageList.Administrator_Permit:Clone()
image.Parent = frame
elseif plr.userId ~= v then
local bp = plr.Backpack
local permit = bp:WaitForChild('Permit', WaitTime)
local frame = permit.Handle.PermitGui
local image = imageList.Legal_Permit:Clone()
image.Parent = frame
end
end
end)

1 comment
I used that to fix infinite yield; now it's saying that ther's a possible Infinite Yield Possible on Players.PufferfishDev.Backpack:WaitForChild('Permit')