#GUI glitched

1 messages · Page 1 of 1 (latest)

brave nacelle
#

When collecting a item it supposed to show +1 or -1 but it keeps overlapping and not disapearing when collected

unreal nightBOT
#

studio** You are now Level 3! **studio

quiet heath
brave nacelle
#

pointEvent.OnClientEvent:Connect(function(points, isRare)
local char = player.Character
if not char then return end
local hrp = char:FindFirstChild("HumanoidRootPart")
if not hrp then return end

local guiBillboard = Instance.new("BillboardGui")
guiBillboard.Adornee = hrp
guiBillboard.Size = UDim2.new(0,100,0,50)
guiBillboard.StudsOffset = Vector3.new(0,3,0)
guiBillboard.AlwaysOnTop = true
guiBillboard.Parent = gui

local label = Instance.new("TextLabel")
label.Size = UDim2.new(1,0,1,0)
label.BackgroundTransparency = 1
label.Text = (points > 0 and "+"..points or tostring(points))
label.TextColor3 = isRare and Color3.fromRGB(255,215,0) or (points > 0 and Color3.fromRGB(0,255,0) or Color3.fromRGB(255,0,0))
label.Font = Enum.Font.ArialBold
label.TextScaled = true
label.Parent = guiBillboard

local tween = TweenService:Create(label, TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.Out), {TextTransparency=1, StudsOffset=Vector3.new(0,6,0)})
tween:Play()
tween.Completed:Connect(function() guiBillboard:Destroy() end)

end)

brave nacelle
#

what am i looking for ?

quiet heath
#

Also are you trying to make the newest gui overlap the oldest or straight up make the oldest disappear?

brave nacelle
#

oldest disappear

quiet heath
#

local oldestGui
pointEvent.OnClientEvent:Connect(function(points, isRare)
    local char = player.Character
    if not char then return end
    local hrp = char:FindFirstChild("HumanoidRootPart")
    if not hrp then return end
    
    if oldestGui then
      oldestGui:Destroy()
    end

    local guiBillboard = Instance.new("BillboardGui")
    guiBillboard.Adornee = hrp
    guiBillboard.Size = UDim2.new(0,100,0,50)
    guiBillboard.StudsOffset = Vector3.new(0,3,0)
    guiBillboard.AlwaysOnTop = true
    guiBillboard.Parent = gui
    oldestGui = guiBillboard

    local label = Instance.new("TextLabel")
    label.Size = UDim2.new(1,0,1,0)
    label.BackgroundTransparency = 1
    label.Text = (points > 0 and "+"..points or tostring(points))
    label.TextColor3 = isRare and Color3.fromRGB(255,215,0) or (points > 0 and Color3.fromRGB(0,255,0) or Color3.fromRGB(255,0,0))
    label.Font = Enum.Font.ArialBold
    label.TextScaled = true
    label.Parent = guiBillboard

    local tween = TweenService:Create(label, TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.Out), {TextTransparency=1, StudsOffset=Vector3.new(0,6,0)})
    tween:Play()
    tween.Completed:Connect(function() guiBillboard:Destroy() end)
end)
#

@brave nacelle lmk

#

i edited couple stuff

brave nacelle
#

That worked perfecty. But now persay if there afk how do i make it disappear from off the screen

#

so the oldest disappeared which was perfect but now if i were to collect one it stays on the screen until i collect another

quiet heath
#

mb

#

i gotchu

brave nacelle
#

No worries 😄

#

Just @ me when done 🙂

#

thanks!

quiet heath
#

yeah couple errors u have mb imma do it now

unreal nightBOT
#

studio** You are now Level 2! **studio

brave nacelle
quiet heath
#
local oldestGui
local LABEL_LIFETIME = 2
pointEvent.OnClientEvent:Connect(function(points, isRare)
    local char = player.Character
    if not char then return end
    local hrp = char:FindFirstChild("HumanoidRootPart")
    if not hrp then return end
    
    if oldestGui then
      oldestGui:Destroy()
    end

    local guiBillboard = Instance.new("BillboardGui")
    guiBillboard.Adornee = hrp
    guiBillboard.Size = UDim2.new(0,100,0,50)
    guiBillboard.StudsOffset = Vector3.new(0,3,0)
    guiBillboard.AlwaysOnTop = true
    guiBillboard.Parent = gui
    oldestGui = guiBillboard

    local label = Instance.new("TextLabel")
    label.Size = UDim2.new(1,0,1,0)
    label.BackgroundTransparency = 1
    label.Text = (points > 0 and "+"..points or tostring(points))
    label.TextColor3 = isRare and Color3.fromRGB(255,215,0) or (points > 0 and Color3.fromRGB(0,255,0) or Color3.fromRGB(255,0,0))
    label.Font = Enum.Font.ArialBold
    label.TextScaled = true
    label.Parent = guiBillboard

    local tween = TweenService:Create(guiBillboard, TweenInfo.new(LABEL_LIFETIME,Enum.EasingStyle.Quad,Enum.EasingDirection.Out), {StudsOffset=guiBillboard.StudsOffset + Vector3.new(0,6,0)})
    tween:Play()
    local fadeTween = TweenService:Create(label, TweenInfo.new(LABEL_LIFETIME,Enum.EasingStyle.Quad,Enum.EasingDirection.Out), {TextTransparency=1})
    fadeTween:Play()
    fadeTween.Completed:Connect(function() guiBillboard:Destroy() end)
end)
#

@brave nacelle

brave nacelle
#

Will try i will let you know how it goes

quiet heath
#

textlabels dont have studsoffset

brave nacelle
#

thanks

#

oh

quiet heath
#

billboards guis dont have texttransparency

#

textlabels use .Position

#

in this case i increased the billboardgui stud offset so the textlabel doesnt clip out the billboard gui when floatingup

#

LABEL_LIFETIME is the time it takes to die out

brave nacelle
#

Yes! it worked

#

thank you so much for the help

#

❤️

quiet heath
#

np mark it a solved gl w ur game

brave nacelle
#

xD good to know!