So I want my lever to go up and down but it twists then goes up and down what is the problem here

Vid link: https://streamable.com/cejhwu script:

local bar = script.Parent.Bar
local cd = script.Parent.Bar.ClickDetector
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(
	0.3,    
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local pulleddown = script.Parent.pulled.Value
local Positions = script.Parent.Positions
local uppos = {CFrame = CFrame.new(Positions.uppos.Position)}
local downpos = {CFrame = CFrame.new(Positions.downpos.Position)}
local up = ts:Create(bar,ti,uppos)
local down = ts:Create(bar,ti,downpos)
local re = game.ReplicatedStorage.lockdown
local function pulled()
	if pulleddown == false
	then 
		down:Play()
		pulleddown = true
		re:FireAllClients()
	elseif pulleddown == true then
		up:Play()
		pulleddown = false
end
end
cd.MouseClick:Connect(pulled)

1 comment

0

It looks like you changed the orientation at some point. It's just a problem with the positioning. Try different positions, and it should work.