So i’m making a chair lift that when a player gets on it starts to move that part works, but when the player gets off and back on they start to slide how can I fix this.
local rails = script.Parent.Parent:WaitForChild("Rail")
local main = script.Parent:WaitForChild("Primary")
local ts = game:GetService("TweenService")
local nodes = {}
wait(1)
for i,v in pairs(script.Parent:WaitForChild("Model"):GetChildren()) do
if v:IsA("Seat") then
v.Changed:connect(function()
if v.Occupant ~= nil then
for i,v in pairs(v.Occupant.Parent:GetChildren()) do
if v:IsA("BasePart") then
v.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
end
end
end
end)
end
end
for i,v in pairs(rails:GetDescendants()) do
if v:IsA("Attachment") and v.Name == "Node" then
table.insert(nodes, v)
print(v.Parent.Name)
end
end
while true do
for i,v in pairs(nodes) do
local goal = {}
goal.CFrame = v.Parent.CFrame + Vector3.new(0, .309, 0)
ts:Create(main, TweenInfo.new(v.Parent.Time.Value, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), goal):Play()--]]
wait(v.Parent.Time.Value)
end
end
Proof of error
part 1 https://gyazo.com/4c6917462c011c77b93e2720f7298695
part 2 https://gyazo.com/7148d3ed55fd911a3053e3e12f2bf693
Any help would be nice thanks!