Hi! I’m looking for someone who’s able to code a coaster. I’ve made a layout and cart already.
I’ve been trying to script a Tween & Lerp-script myself, but i really can’t figure it out.
This might due to because i’m Dutch. Meaning reading and listening to English tutorials is kinda hard to do sometimes.
I’ve tried using for i in combo with CFrame:Lerp and using Tween:Play(), but couldn’t figure it out.
This is the best i got:
local Cart = workspace:WaitForChild('Train1')
local Train1 = Cart:WaitForChild('FrontCar')
local ThisCar = script.Parent
local Tracks = workspace:WaitForChild('Tracks')
local TrackNumb = 1
local Int = 0.1
repeat
local Stop = script.Parent.StopValue.Value
Finish = workspace.Tracks:FindFirstChild('Part'..TrackNumb).CFrame
for i = 0,1,Int do
local CFrameMath = script.Parent.FrontCar.PrimaryPart.CFrame:lerp(Finish,i)
Train1:SetPrimaryPartCFrame(CFrameMath)
wait()
end
TrackNumb = TrackNumb +1
if TrackNumb >6 then
wait()
TrackNumb = 1
end
until Stop == true
I know requesting someone to write a script/help me, isn’t really appreciated here. But, please. Help this poor user. I really tried my best.
(Edit) The problem with the script above is that the cart stops on every part, instead of going smooth to each other without stopping.