I am trying to see is a GUI exists in PlayerGui, and if not, print that it was not found. I always get this error: ReloadHUD is not a valid member of PlayerGui
This is my code, its a LocalScript inside a tool:
script.Parent.Unequipped:Connect(function()
out = false
idle:Stop()
shootfunction:Disconnect()
local rhud = game.Players.LocalPlayer.PlayerGui
if rhud.ReloadHUD then -- If it exists, remove it.
rhud:remove()
elseif not rhud.ReloadHUD then -- If its not there print it wasn't found.
print("noreloadguiwasfound")
end
end)

4 comments
use FindFirstChild()
add yield
@GoldAngellnDisguise Thank you, it worked. I feel dumb now lol.
accept a random answer