Coding Global Background
Coding Global

Help with lua

Archiviert 17 days ago
26 Nachrichten
4 Mitglieder
Erstellt 4 months ago
Aktualisiert 17 days ago
In Discord öffnen
_
Eppu
Verified
I am trying to make and elevator but It is not working, somebody help?

"Elevator" is union
I am just trying to move "elevator", not button
 local ts = game:GetService("TweenService")

local elevator = script.Parent.Elevator
local btns = script.Parent.Buttons
local btn1 = napit.Button1

local clickDetector1 = btn1.Button.ClickDetector

local currentPos = elevator.Position

local tweenInfo = TweenInfo.new(
    9, 
    Enum.EasingStyle.Quad,
    Enum.EasingDirection.InOut,
    0,
    false,
    0
)

local function onClicked(player)
    local tween = ts:Create(elevator, tweenInfo, {CFrame = CFrame.new(-48, 30.3, -99.9)})
    tween:Play()
end

clickDetector1.MouseClick:Connect(onClicked)

Antworten (24)