Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a fixed BillboardGui?

Asked by 6 years ago

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
0
Having wait with no parameters deafults to 0.0299999. Also, I think the default wait is too fast already, and now your shrinking the wait??? hiimgoodpack 2009 — 6y
0
Also, try to replace infinite loops with the one on the bottom of your script. Not gonna answer it since you didnt indent properly. hiimgoodpack 2009 — 6y
0
set TextScaled to true and use only the Scale in UDim2 creeperhunter76 554 — 6y
0
Wth, I am not reading this post greatneil80 2647 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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

0
Ah. Thanks! TechnologicalDiamond 2 — 6y
Ad

Answer this question