So I made a script that is supposed to slide the "Slide" part of my gun to the "SlideStop" part:
Function Shoot()
local heartbeat = game:GetService("RunService").Heartbeat
local duration = 5
local alpha = 0
while alpha < 1 do
alpha = alpha + (heartbeat:wait() / duration)
script.Parent.Slide.ManualWeld.C1 = script.Parent.Slide.ManualWeld.C1:lerp(script.Parent.SlideStop.CFrame,alpha)
end
end
But when I run this function, the Slide Part lerps somewhere else and starts spazzing. What am I doing wrong?
