This the Local Script:
local vehicle = game.Workspace.Robbery.SubmarineExterior
game:GetService("RunService").Heartbeat:Connect(function(dt)
vehicle:SetPrimaryPartCFrame(vehicle.PrimaryPart.CFrame * CFrame.new(-0.1, 0,0 * dt))
wait(5)
vehicle:SetPrimaryPartCFrame(vehicle.PrimaryPart.CFrame * CFrame.new(-0.1, 0.05,0 * dt))
wait(5)
vehicle:SetPrimaryPartCFrame(vehicle.PrimaryPart.CFrame * CFrame.new(-0.1,0,0 * dt))
end)
And this is the model regenerate Server Script:
object = script.Parent
if (object ~= nil) and (object ~= game.Workspace) then
model = object
backup = model:clone()
waitTime = script.Parent.Time.Value
wait(1)
while true do
wait(waitTime+2)
model:remove()
model = backup:clone()
wait(2)
model.Parent = game.Workspace
model:makeJoints()
end
end
For some reason the local script wont work when the model get regenerated and theres no error messages.