Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to make a castle bridge entrance tween ?

Asked by 4 years ago

So, i've started working on a castle bridge entrance, my goal is to make it rotate at a 90 degree angle, my issue is it's not working, please provide me with some tips to solve this problem. (keep in mind that it's a local script in the StarterGui because i am working on a pop up letter Gui so the player is aware that he can interact with this item and what key he should press)

local uis = game:GetService("UserInputService")
local inRange = false
local service = game:GetService("TweenService")
local part = game.Workspace.part1

local info = TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false)

local open = {CFrame = part.CFrame * CFrame.Angles(0, 0, math.rad(90))}

local create = service:Create(part, info, open)

uis.InputBegan:Connect(function(input, proccesed)
    if input.KeyCode == Enum.KeyCode.E and proccesed and inRange then
        create:Play()
    end
end)
0
I would not reccomend a tween, search up roblox drawbridge on youtube emervise 123 — 4y
0
user is never in range(variable never true), and input is only "proccesed" when user is typing in ui(eg chat) Leamir 3138 — 4y

Answer this question