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

Is it posible to stop TweenService?

I am trying to make a lava witch goes up but once you die the lava stops rising and goes to the begining but i found a problem that once you die the lava dosent stop going up here is the script

local tweenservice = game:GetService("TweenService")
local lava = game.Workspace.Downs
local deb = false
script.Parent.Touched:Connect(function()
deb = true
local Properties = {
	Position = Vector3.new(-541, 31.75, -2.4)} -- location were it goes
local TweenInfoo = TweenInfo.new(30,Enum.EasingStyle.Sine,Enum.EasingDirection.In)
local tween = tweenservice:Create(lava,TweenInfoo,Properties)
wait(2)
	tween:Play()
	wait(5)
	deb = false
end)

game.Players.PlayerAdded:connect(function(plr) -- script that detects once player dies
    plr.CharacterAdded:connect(function(chr)
		        chr:WaitForChild("Humanoid").Died:connect(function()
			lava.Position = Vector3.new(-541, -40.65, -2.4) -- sets lava to begining
		end)
	end)
end)

1 answer

✓ Accepted answer

You can use tween:Pause() to pause a tween.


API Reference:

TweenService


If this helps, please mark this answer as accepted

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