- What do you want to achieve?
I want a gate system where the gate opens upright and straight(at an angle of 90 degrees).
- What is the issue?
I tried to make a toll gate system, using the script which is embedded below this message but the gate doesn’t seem to work as intended. I want it to open up straight, but it seems to be a bit inclined. As I am not not a professional scripter, I cannot identify the error.
- What solutions have you tried so far?
I have tried to look for solutions on the internet as well as the Developer Forum, but could not find any answers that meet my demands.
The Script:
local gate = workspace:WaitForChild("Right Gate")
local maingate = gate:WaitForChild("Gate2")
local gatepart = maingate:WaitForChild("Gate")
local button = workspace:WaitForChild("RightButton"):WaitForChild("Button"):WaitForChild("ProximityPrompt")
local newPos = CFrame.Angles(math.deg(0), math.deg(-90), math.deg(-90))
button.Triggered:Connect(function()
gatepart.Position = Vector3.new(424.512, 5.14, -843.48)
gatepart.CFrame = CFrame.new(gatepart.Position) * newPos
print("yes")
end)
Outcome:
robloxapp-20240424-0803387.wmv (1.7 MB)