#GUI glitched
1 messages · Page 1 of 1 (latest)
** You are now Level 3! **
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)
what am i looking for ?
Make this script a codeblock
Also are you trying to make the newest gui overlap the oldest or straight up make the oldest disappear?
oldest disappear
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
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
yeah couple errors u have mb imma do it now
** You are now Level 2! **
thanks ❤️
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
Will try i will let you know how it goes
textlabels dont have studsoffset
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
np mark it a solved gl w ur game