-
What do you want to achieve? Make a lava that stops when touches a part.
-
What is the issue? The touch doesnt stop it.
local speed = 100
local gameRunning = game.Workspace.data.gameRunning.Value
local playersLeft = game.Workspace.data.playersLeft.Value
local endWall = script.Parent.Parent.room.endWall
local defSize = script.Parent.Size
local defCFrame = script.Parent.CFrame
local lavaSpeed = speed/100
wait(5)
endWall.Touched:Connect(function(hit)
if hit.Name == "lava" then
script.Parent.Size = defSize
script.Parent.CFrame = defCFrame
gameRunning = false
end
end)
while wait(0.01) do
local gameRunning = game.Workspace.data.gameRunning.Value
local playersLeft = game.Workspace.data.playersLeft.Value
if gameRunning == false then elseif playersLeft == 0 then else
script.Parent.Size = Vector3.new(script.Parent.Size.X,script.Parent.Size.Y,script.Parent.Size.Z+lavaSpeed)
script.Parent.CFrame = CFrame.new(script.Parent.CFrame.X,script.Parent.CFrame.Y,script.Parent.CFrame.Z+lavaSpeed/2)
end
end