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)

01local uis = game:GetService("UserInputService")
02local inRange = false
03local service = game:GetService("TweenService")
04local part = game.Workspace.part1
05 
06local info = TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false)
07 
08local open = {CFrame = part.CFrame * CFrame.Angles(0, 0, math.rad(90))}
09 
10local create = service:Create(part, info, open)
11 
12uis.InputBegan:Connect(function(input, proccesed)
13    if input.KeyCode == Enum.KeyCode.E and proccesed and inRange then
14        create:Play()
15    end
16end)
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