I feel so stupid right now because somehow I cant figure out how to add a gui once in the character whenever they first load in and anytime they respawn, anything I’ve tried doesn’t work or has some other weird result
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local powerBarGui = script.Parent
local function addGui(character: Model)
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart", true)
if humanoidRootPart then
local newPowerBarGui = powerBarGui:Clone()
newPowerBarGui.Enabled = true
newPowerBarGui.Parent = humanoidRootPart
end
end
if localPlayer.Character then
addGui(localPlayer.Character)
end
localPlayer.CharacterAdded:Connect(addGui)
I am unsure why you need a script to clone a Gui into the player, as Roblox already does this for you if you put the Gui into StarterGui. If you need the Gui to reset itself every time the player respawns, leave the ResetOnSpawn value enabled.
Oh, you should have clarified that bit, I would have given a solution earlier if that was in the original post. But yes, its simple to do that, just clone the BillboardGui into the player’s character. You should be able to do that inside of a CharacterAdded connection in a server script pretty easily.