Hello Roblox,
Always when i run my code:
for _, object in ipairs(workspace:GetDescendants()) do
if object:IsA("ProximityPrompt") then
if object.Parent:FindFirstChild("Humanoid") then
if object.KeyboardKeyCode == Enum.KeyCode.Q then
object.Triggered:Connect(function(Player)
loadanim:Play()
object.Parent.Humanoid.Health = 0
object.Parent.ClickDetector:Destroy()
object.Parent.PromptScript:Destroy()
object.Parent.ProximityPrompt:Destroy()
object.Parent.BillboardGui:Destroy()
end)
end
end
end
end
I get this error: Players.Mainixy.PlayerScripts.LocalScript:13: attempt to index nil with ‘BillboardGui’
Please help me.
~Maini