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

This is my first time experiencing with gui tweens, why does this not work?

Asked by 6 years ago

local SBar = script.Parent:WaitForChild("BackG"):WaitForChild("SBar") while _G.Stamina > 0 and wait(.1) do print "test" SBar:TweenSize(UDim2.new(0, _G.Stamina/100, 0, 1, 0), "Out", "Quint", .1, true) end

0
A code block would be very nice! User#20388 0 — 6y
0
btw, _G. isn't so good, use remote functions instead User#20388 0 — 6y
0
code block, what do you mean? Omega677 15 — 6y

1 answer

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

Hello wowie, my name is Swift. I am here to help you:

I have expected errors: 1: There are 5 arguments in UDim2.new() 2: I recommended using only one :WaitForChild() 3: I recommended not to shortcut 0.1 4: If the GUI was already in the player's screen, with that configuration, the GUI will disappear almost immediately, if you want it to go out from the user's screen; please use 'In'; but from my consideration; the GUI must be some sort of bar; so you can use out. You might want to fix "0.1" speed though, it's too fast.'

This might be the fixed version.

local SBar = script.Parent.BackG:WaitForChild("Sbar")

while _G.Stamina > 0 and wait(0.1) do
    print("test")
    SBar:TweenSize(UDim2.new(0,_G.Stamina/100,0,1),'Out','Quint', 0.1, true)
end
Ad

Answer this question