#Quick help ?

1 messages · Page 1 of 1 (latest)

timber kelp
#

is there any way i can turn this door script into a sliding door and not a teleporting door since all it does is teleport to 4 tiles away at the moment
local Door = script.Parent
local OriginalDoorPos = Door.CFrame
local Opened = false

local function Minipdoor()
if Opened then
warn("Close Door")
Door.CFrame = OriginalDoorPos
else
warn("Open Door")
Door.CFrame = Door.CFrame * CFrame.new(Vector3.new(4, 0, 0))
end

Opened = not Opened

end

script.Parent.ProximityPrompt.Triggered:Connect(function()
Minipdoor()
end)

trim glen
#

tweenservice

timber kelp
hexed elmBOT
#

studio** You are now Level 3! **studio

timber kelp
#

im new to allis

trim glen
wraith stream
#

I'm felling generous today.

local Door = script.Parent
local OriginalDoorPos = Door.CFrame
local Opened = false
local TweenService = game:GetService("TweenService")

local function Minipdoor()
    if Opened then
        warn("Close Door")
        TweenService:Create(Door, TweenInfo.new(2), {CFrame = OriginalDoorPos}):Play()
        
    else
        warn("Open Door")
        TweenService:Create(Door, TweenInfo.new(2), {CFrame = Door.CFrame * CFrame.new(Vector3.new(4, 0, 0))}):Play()
        
    end

    Opened = not Opened
end

script.Parent.ProximityPrompt.Triggered:Connect(function()
    Minipdoor()
end)
#

If it gives you an error let me know

#

discord is not a good ide

#

Make sure you also read the docs

#

cus tween service is VERY good to know