What do you want to achieve? am trying to make my lever switch smoothly
What is the issue? for some reason it ain’t working and there are no errors showing up
What solutions have you tried so far? i tried searching up a tutorial didn’t work tho dev forum is my only hope tbh-
local click = script.Parent.ClickDetector
local model = script.Parent
local endpos = game.Workspace.endpos
local TS = game:GetService("TweenService")
local info = TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut, 0, false)
click.MouseClick:Connect(function()
TS:Create(model, info, {CFrame = endpos.CFrame})
click:Destroy()
end)
am also trying to make the lever a one time use so it shouldn’t work again, thank you in advance <3
local click = script.Parent.ClickDetector
local model = script.Parent
local endpos = game.Workspace.endpos
local TS = game:GetService("TweenService")
local info = TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut, 0, false)
click.MouseClick:Connect(function()
local tween = TS:Create(model, info, {CFrame = endpos.CFrame})
tween:Play()
tween.Completed:Wait()
click:Destroy()
end)
remove the tween.Completed:Wait() if you don’t want it to finish before deleting.