#How to make a NPC car going in a straight line and then respawn to do it again
1 messages · Page 1 of 1 (latest)
use tweenservice on an anchored car
https://create.roblox.com/docs/reference/engine/classes/TweenService
just a car that goes one way and respawns, you cant interact with it in any way ]
then yep use ts
Just Clone ur car where you want it to be and use while true do for loop or something like this
okay but how to make it only go one direction, despawn then wait and go this direction again
...
local tween = ... --Create your tween here
tween:Play()
tween.Completed:Wait() --It will wait for the tween to finish
car:Destroy() --Then destroy the car
oki thx
** You are now Level 1! **
you can make the tween repeat itself infinitely which means you dont even need to destroy the car
why dislike tho if he need it repeat it
i meant it like
While True do
local Car = rs.Car
car.Parent = game.workspace
car.Cframe = part.CFrame
Local Tween = TS:Create(Car,TweenInfo.new(1),{CFrame = car.CFrame * CFrame.New(0,0,-10)}):Play()
task.Wait(5)
Car:destroy()
end
im kinda confused where to add it
In a server script
idk about any previous script
i used looping tween