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

How i pause the Tweening?

In the Script, with you hold E, a Power Bar start to fill, but i don't know how to Pause the Tweening when the Player stops hold E.

Script:

Ok = false

function SubirForca(inputObject, gameProcessedEvent)
    if inputObject.KeyCode == Enum.KeyCode.E then
        Ok = true
        if Ok == true then
            script.Parent.Forca:TweenSize(UDim2.new(0, 200, 0, 20), "Out", "Linear")
			print("Subindo barra de força")
        end
    end
end

game:GetService("UserInputService").InputBegan:connect(SubirForca)
	
function ManterForca()
	Ok = false
	print("Força mantida")
end

game:GetService("UserInputService").InputEnded:connect(ManterForca)

2 answers

✓ Accepted answer

Use TweenService to create a new Tween instance, which can then be Pause()d.

2 comments

0

I believe he's using a GuiObject.

0

You can still use TweenService.

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