I scripted with a Breakdown Crane Controller, and it doesn’t do. So I created a Crane Controller script with constraints, look in my script:
local UpCraneButton = script.Parent.UpCraneButton
local DownCraneButton = script.Parent.DownCraneButton
local LiftUpButton = script.Parent.LiftUpButton
local LiftDownButton = script.Parent.LiftDownButton
local AttachButton = script.Parent.AttachButton
local Controlled = false
local BreakdownCrane = game.Workspace.BreakdownCrane
local ArmConstraint = BreakdownCrane.Arm:FindFirstChild("RopeConstraint")
local Hook = BreakdownCrane.Hook
local HookConstraint = Hook.CraneConstraint:FindFirstChild("RopeConstraint")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function()
Controlled = true
end)
UserInputService.InputEnded:Connect(function()
Controlled = false
end)
local function onArmControlled()
ArmConstraint.Length = math.round(1)
end
local function ArmControlledDown()
ArmConstraint.Length = math.round(-1)
end
local function onHookControlled()
HookConstraint.Length = math.round(1)
end
local function HookControlledDown()
HookConstraint.Length = math.round(-1)
end
LiftUpButton.MouseButton1Click:Connect(onArmControlled)
LiftDownButton.MouseButton1Click:Connect(ArmControlledDown)
UpCraneButton.MouseButton1Click:Connect(onHookControlled)
DownCraneButton.MouseButton1Click:Connect(HookControlledDown)
Does it seem I can’t control my Breakdown Train? So, show in my video:
Instantly, it can’t lift and attach with an arm and hook. How do I script the crane that can work?