I'm trying to create a BillboardGui from a script to show HP and the name of something. When I create the BillboardGui and have the scripted text come out, it zooms in and out if I do. Can I try and fix this so I don't get super annoyed by it? LocalScript code below; please tell me if I did anything wrong or if I can add something. Thanks!
wait(3) local ChatGui = Instance.new("BillboardGui",game.Players.LocalPlayer.Character.Head) local ChatBox = Instance.new("TextBox",ChatGui) local PlayerChar = game.Players.LocalPlayer PlayerChar.Character.Humanoid.MaxHealth = 9271 PlayerChar.Character.Humanoid.Health = 9271 function write(text) for i = 1,string.len(text) do ChatBox.Text = string.sub(text,1,i) wait(0.01) end end ChatGui.Size = UDim2.new(0,200,0,50) ChatBox.BackgroundTransparency = 1 ChatBox.BorderSizePixel = 0 ChatBox.Position = UDim2.new(0,0,0,-35) ChatBox.Font = "Arcade" ChatBox.TextColor3 = Color3.new(0,255,255) ChatBox.TextScaled = false ChatBox.TextStrokeTransparency = 0 ChatBox.TextStrokeColor3 = Color3.new(255,255,255) ChatBox.TextStrokeTransparency = 0 ChatBox.TextWrapped = false ChatBox.Size = UDim2.new(0.99,0,0.72,0) ChatBox.TextSize = 32 local chatting = false game.Players.LocalPlayer.Chatted:connect(function(msg) chatting = true write(msg) wait(3) chatting = false end) while wait() do if chatting == false then ChatBox.Text = "Diamond the Developer // HP - "..PlayerChar.Character.Humanoid.Health.."/"..PlayerChar.Character.Humanoid.MaxHealth else wait() end end
You are using offset as a size measure of the Billboard, using scale would fix it.
Offset:
{0, 200}
Scale
{0.2, 0}
That is an example of what I mean with Scale and Offset