Made an elevator with constraints physics using align position and bodymovers (bodygyro), and despite having all correct parent referencing through my script along with both align position instances disabled by default, my script refuses to work (potentially because of unreachable code I’m guessing?). Anyways I came here looking to see if I could get some help on how to solve this because all I need the elevator is to simply either go up or down according to the config folders located in the button models.
Explorer reference for buttons:
Explorer reference for elevator floor part:
Code:
local hitbox = script.Parent.Parent
local elevator = script.Parent.Parent.Parent.Parent.Parent.Elevator
local config = script.Parent.Parent.Parent.Configuration
hitbox.ClickDetector.MouseClick:Connect(function()
if config.Up == true then
if config.Down == true then
error("You have both up and down settings for "..hitbox.Parent.Name.." enabled! Elevator will not be activated to ensure physics safety")
else
elevator.Up.Enabled = true
wait(10)
elevator.Up.Enabled = false
end
end
if config.Down == true then
if config.Up == true then
error("You have both up and down settings for "..hitbox.Parent.Name.." enabled! Elevator will not be activated to ensure physics safety")
else
elevator.Down.Enabled = true
wait(10)
elevator.Down.Enabled = false
end
end
end)
0 errors are presented in the output so I have no idea what’s going on. Any assistance?