Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

3 comments

0

A code block would be very nice!

0

btw, _G. isn't so good, use remote functions instead

0

code block, what do you mean?

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.