so the idea is the spike shoots up from the ground and goes back, but it glitches like in the video below, heres the code:
local Workspace = game:GetService("Workspace")
local Icespike1 = Workspace:FindFirstChild("Icespike1")
local positions = {
Vector3.new(16.815, -112, -124.477),
Vector3.new(16.815, -102, -124.477),
Vector3.new(16.815, -92, -124.477),
Vector3.new(16.815, -82, -124.477),
Vector3.new(16.815, -65, -124.477)
}
local orientationY = math.rad(-90)
local orientationZ = math.rad(5.342)
while true do
task.wait(3)
local rng = math.random(1, 5)
local baseCFrame = CFrame.new(positions[1]) * CFrame.Angles(0, orientationY, orientationZ)
Icespike1:PivotTo(baseCFrame)
if rng == 3 then
for i, pos in positions do
local moveCFrame = CFrame.new(pos) * CFrame.Angles(0, orientationY, orientationZ)
Icespike1:PivotTo(moveCFrame)
task.wait(0.01)
end
task.wait(2)
for i = #positions, 1, -1 do
local moveCFrame = CFrame.new(positions[i]) * CFrame.Angles(0, orientationY, orientationZ)
Icespike1:PivotTo(moveCFrame)
task.wait(0.01)
end
end
end
** You are now Level 8! **