Lava Rising Script Help? **New Problem**

Problem
I want to add a few seconds before the the lava starts rising up
it probably may be as easy as putting a wait function but for some reason im not really sure how to go about it
Code
local Rs = game:GetService(“RunService”)

local lava = game.Workspace.LavaBottom.Part

lavapos = Vector3.new(7.735, 7.952, -36.3)

local startime = tick()

while true do

dif = (tick() - startime)*2

lava.Size = Vector3.new(100.097, dif, 100.597)

lava.Position = Vector3.new(7.735, 7.952, -36.3)

Rs.Heartbeat:Wait()

end
Summarization
To Summurize it i want the lava part to wait a few seconds before it scales itself in the z axis
New Problem
When I Add A Wait Function Before the While Loop, And After The Wait Function Gets Over,The Lava Rises 5 Times as quicker to a certain area then returns to its normal speed. How Do I Go About This

So it tweens itself to get bigger and higher using tween service or not?

put a wait before the while loop starts.

It dosent use tween service im using the tick command to keep on move/ scalling it size on the z axis
although tween service isnt a bad idea

yea ill try that Right Now And Get Back To You

yup im dissapointed in myself again tysm it worked

wait a second another problem arises

I had a similar problem so I googled it and here is one of the tutorials I watched that helped me. How to make rising/killing lava in Roblox - YouTube

Umm in the tutorial It Put A Wait Function Without an input in which is fine.
However i wanted a wait time then after waiting it started rising.When i put a wait function before the loop it rised 5 times faster and i dont want that to happen

Then the start time variable should be defined after the wait, not before.

If you want your lava to forever keep rising, you should do this:

game:GetService("RunService").Stepped:Connect(function()
	script.Parent.Position = script.Parent.Position + Vector3.new(script.Parent.Position.X,difference,script.Parent.Position.Z)
	script.Parent.Size = script.Parent.Size + Vector3.new(script.Parent.Position.X,difference,script.Parent.Position.Z)
end)

but, if you want to make it go to a specific position:

local tweenService = game:GetService("TweenService")
local ti = TweenInfo.new(
	1, --seconds it takes for the part to reach where you want it to go
	Enum.EasingStyle.Linear, -- the easing style, look up "roblox easingstyles for more
	Enum.EasingDirection.InOut, --affects the easingstyle animation
	0, --the amount it should repeat this process
	false, --if it repeats more than once, should it tween backwards?
	0 -- if it repeats, then how much should the delay be between tweens?
)

local sizeToReach = size
local positionToReach = position
local partToTween = part

tweenService:Create(partToTween,ti,partToTween):Play()
1 Like

Dosent Work Sadly As It Moves Once then waits 10 seconds again