Plane Gui Not Showing Up

I was working on a plane and thought of adding a gui to show the plane velocty and altitude but it doesnt work the gui doesnt show up

local Plane = script.Parent.Plane.Value
local Settings = require(Plane.Parent.Settings.Config)
Plane.PilotSeat:GetPropertyChangedSignal("Occupant"):Connect(function()
	local plr = game.Players:GetPlayerFromCharacter(Plane.PilotSeat.Occupant.Parent)
	print(plr.."seated")
	if plr then
		local gui= Instance.new("ScreenGui")
		gui.Parent = plr.PlayerGui
		gui.Name = "PlaneGui"
		local Frame = script.Frame:Clone()
		Frame.Parent = gui
		while wait() do
			local Engine = Plane:FindFirstChild("Engine")
			local vSpeed = math.sqrt((Engine.Velocity.x)^2+(Engine.Velocity.y)^2+(Engine.Velocity.z)^2)
			Frame.ALT.Text = ' ALTITUDE: ' .. math.ceil(Plane.Engine.Position.Y -5)
			if math.floor(vSpeed) <= Settings.StallSpeed then
				Frame.SPD.TextColor3 = Color3.new(1, 0.462745, 0.415686)
			elseif math.floor(vSpeed) > Settings.StallSpeed then
				Frame.SPD.TextColor3 = Color3.new(255, 255, 255)
			end
			Frame.SPD.Text = " SPEED:  ".. math.floor(vSpeed).." Kt"
			Frame.COORDS.Text = "COORDS:("..math.ceil(Engine.Position.X)..","..math.ceil(Engine.Position.Z)..")"
		end
	else
		plr.PlayerGui.PlaneGui:Destroy()
	end
end)

pls help thx

1 Like

Try setting the Frame to visible and the ScreenGui Enabled to true

but when i check my PlayerGui they dont clone so thats the problem

nvm it worked

What was your fix? ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

sorry man i have no idea,i did this LOOONG time ago and i was very bad then

1 Like

Not a problem thanks though! :slight_smile:

He used ScreenGui.Enabled or Frame.Visible = true

https://developer.roblox.com/en-us/api-reference/class/ScreenGui

Nah its not that but thanks though

What is it then? I would be happy to help if I can.