So this chunk of script is running ina LocalScript and is triggered by a RemoteEvent (as shown) tht is fired in a script in ServerScriptService. The part that I'm emphasizing is the area that is using TweenSize. For some reason, it only works sometimes, and randomly. Any clue or ideas why?
game.ReplicatedStorage.StatsRemote.OnClientEvent:connect(function(wood,gold) local woodpercent = wood / maxwood.Value local woodpercentsize = woodpercent * 280 local roundedwoodpercentsize = math.floor(woodpercentsize+.5) local goldpercent = gold / maxgold.Value local goldpercentsize = goldpercent * 280 local roundedgoldpercentsize = math.floor(goldpercentsize+.5) script.Parent.WoodAmount:TweenSize(UDim2.new(0,roundedwoodpercentsize,0,40)) script.Parent.GoldAmount:TweenSize(UDim2.new(0,roundedgoldpercentsize,0,40)) end)
thats not how you tween there is alot that goes into it but heres what you can use for now and a link to more info
Link: https://www.youtube.com/watch?v=VVQzx6yamJU
Just copy/ paste link isn't working rn
Example:
script.Parent.GoldAmount:TweenSize(UDim2.new(0,roundedgoldpercentsize,0), "In", "Linear",2, false)