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)
Don't use timeOut and see if that fixes it.
Script:
local administrators = { 698511703 } 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') 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)