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

Backpack surface gui frame size will not work?

Asked by 4 years ago
Edited 4 years ago

So i am trying to advance in the simulator side of games right now i am working on a backpack with a bar showing you max amount of coral, and your current amount of coral here is the code i don't know where to start with making the frame the perfect size

wait(1)

local Bar = script.Parent.Bar

local Storage= script.Parent.Storage

local Label = script.Parent.TextLabel

local Char = script.Parent.Parent.Parent.Parent

local Player = game.Players:GetPlayerFromCharacter(Char)

local Coral = Player.leaderstats.Coral

Label.Text = Coral.Value.."/"..Storage.Value

local Math = Coral.Value / 400

local Math2 = Math * Storage.Value

Bar.Size = UDim2.new(0,Math2,1,0)

Coral.Changed:Connect(function(Cor)

Label.Text = Coral.Value.."/"..Storage.Value

local Math = Coral.Value / 400

local Math2 = Math * Storage.Value

Bar.Size = UDim2.new(0,Math2,1,0)

end)

Answer this question