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

Custom points GUI isnt tweening correctly?

Asked by 6 years ago

I have a points GUI on the top of the screen and everytime a player dies it removes points.

But for some reason its doing this odd thing heres a picture because i cannot possibly explain this.

https://imgur.com/a/K9kgk

It for some reason like super expands the actual size of the text, I dont know why.

Heres the code incase that may be the problem

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local BlueTeamPoints = ReplicatedStorage:WaitForChild("BlueTeamPoints")
local RedTeamPoints = ReplicatedStorage:WaitForChild("RedTeamPoints")

local BlueOverlay = script.Parent.BlueTicketsBackground
local RedOverlay = script.Parent.RedTicketsBackground

function Update()
    local BluePoints = BlueTeamPoints.Value/200
    local RedPoints = RedTeamPoints.Value/200
    BlueOverlay:TweenSize(UDim2.new(BluePoints, 0, 1, 0), "Out", "Quad", .1)
    RedOverlay:TweenSize(UDim2.new(RedPoints, 0, 1, 0), "Out", "Quad", .1)
    wait(.1)
end

Update()

BlueTeamPoints.Changed:connect(Update)
RedTeamPoints.Changed:connect(Update)

Anyone have any ideas? Thank you for your time :)

0
Is that the Bloxwars UI? PolyyDev 214 — 6y
0
Thats my own UI I created. Its based of Battlefront 2's GUI. I dont know what Bloxwars is GottaHaveAFunTime 218 — 6y

1 answer

Log in to vote
0
Answered by
dirk2999 103
6 years ago
Edited 6 years ago

You're using RedPoints and BluePoints in the :TweenSize function. If the Red Team has 100 points, then the RedOverlay will be (100,0,1,0). I'm assuming you dont want to change the size that way, if you're trying to make it dependent on the percent of their score compared to what score they need to get to change BlueOverlay and RedOverlay to,

local points = 75 --Points the teams are trying to achieve

BlueOverlay:TweenSize(UDim2.new((BluePoints/points),0,1,0))
RedOverlay:TweenSize(UDim2.new((RedPoints/points),0,1,0))
0
Im afraid that doesnt work. Any other ideas? GottaHaveAFunTime 218 — 6y
0
Edited. dirk2999 103 — 6y
Ad

Answer this question