--[[ Human Elevator+ (R6/R15 stable) Features: - Rig selector (R6/R15) - Part selector based on rig type - No-slip sticking using AlignPosition & AlignOrientation - Polished UI ]] local Players, UIS = game:GetService("Players"), game:GetService("UserInputService") local LP = Players.LocalPlayer local DIST_BELOW = 3 local SELECTED_PART = "Head" local rigMode = "R15" local conn -- === UI Setup === local gui = Instance.new("ScreenGui", LP:WaitForChild("PlayerGui")) gui.Name, gui.ResetOnSpawn = "ElevatorUI", false local function makeCorner(parent, radius) local c = Instance.new("UICorner", parent) c.CornerRadius = UDim.new(0, radius) end local frame = Instance.new("Frame", gui) frame.AnchorPoint, frame.Position = Vector2.new(0.5, 0.5), UDim2.new(0.5, 0, 0.5, 0) frame.Size, frame.BackgroundColor3, frame.BackgroundTransparency = UDim2.new(0, 240, 0, 340), Color3.fromRGB(25, 25, 25), 0.05 makeCorner(frame, 10) local function makeTextBox(yPos, placeholder, default) local box = Instance.new("TextBox", frame) box.Size, box.Position = UDim2.new(1, -20, 0, 30), UDim2.new(0, 10, 0, yPos) box.PlaceholderText, box.Text = placeholder, default or "" box.TextScaled, box.BackgroundColor3, box.TextColor3 = true, Color3.fromRGB(50, 50, 50), Color3.fromRGB(255, 255, 255) makeCorner(box, 8) return box end local function makeButton(yPos, text, color) local btn = Instance.new("TextButton", frame) btn.Size, btn.Position = UDim2.new(1, -20, 0, 30), UDim2.new(0, 10, 0, yPos) btn.Text, btn.TextScaled, btn.BackgroundColor3, btn.TextColor3 = text, true, color, Color3.fromRGB(255, 255, 255) makeCorner(btn, 8) return btn end -- Title bar local titleBar = Instance.new("Frame", frame) titleBar.Size, titleBar.BackgroundColor3 = UDim2.new(1, 0, 0, 30), Color3.fromRGB(40, 40, 40) makeCorner(titleBar, 10) local titleLabel = Instance.new("TextLabel", titleBar) titleLabel.Size, titleLabel.Position = UDim2.new(1, -30, 1, 0), UDim2.new(0, 10, 0, 0) titleLabel.Text, titleLabel.TextColor3, titleLabel.BackgroundTransparency = "Human Elevator+", Color3.new(1, 1, 1), 1 titleLabel.TextXAlignment, titleLabel.Font, titleLabel.TextSize = Enum.TextXAlignment.Left, Enum.Font.GothamBold, 16 local closeBtn = makeButton(0, "X", Color3.fromRGB(170, 0, 0)) closeBtn.Size, closeBtn.Position, closeBtn.Parent = UDim2.new(0, 30, 1, 0), UDim2.new(1, -30, 0, 0), titleBar -- Inputs local usernameBox = makeTextBox(40, "Username or display name") local distBox = makeTextBox(80, "Distance offset", tostring(DIST_BELOW)) -- Rig/Part selectors local R6Parts = {"Head","Torso","Left Arm","Right Arm","Left Leg","Right Leg","HumanoidRootPart"} local R15Parts = { "Head","UpperTorso","LowerTorso","HumanoidRootPart", "LeftUpperArm","RightUpperArm","LeftLowerArm","RightLowerArm", "LeftHand","RightHand", "LeftUpperLeg","RightUpperLeg","LeftLowerLeg","RightLowerLeg", "LeftFoot","RightFoot" } local availableParts = table.clone(R15Parts) local rigBtn = makeButton(120, "Rig: R15", Color3.fromRGB(100,100,180)) local partBtn = makeButton(160, "Part: "..SELECTED_PART, Color3.fromRGB(70,70,150)) local partIndex = 1 rigBtn.MouseButton1Click:Connect(function() if rigMode == "R15" then rigMode = "R6" availableParts = table.clone(R6Parts) else rigMode = "R15" availableParts = table.clone(R15Parts) end partIndex = 1 SELECTED_PART = availableParts[partIndex] rigBtn.Text = "Rig: "..rigMode partBtn.Text = "Part: "..SELECTED_PART end) partBtn.MouseButton1Click:Connect(function() partIndex = (partIndex % #availableParts) + 1 SELECTED_PART = availableParts[partIndex] partBtn.Text = "Part: "..SELECTED_PART end) -- Start/Stop buttons local startBtn = makeButton(210, "Start", Color3.fromRGB(0, 170, 0)) local stopBtn = makeButton(250, "Stop", Color3.fromRGB(170, 0, 0)) -- Dragging local dragging, dragStart, startPos local function updateDrag(input) local delta = input.Position - dragStart frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging, dragStart, startPos = true, input.Position, frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) titleBar.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then updateDrag(input) end end) -- === Helpers === local function getHRP(char) return char and char:FindFirstChild("HumanoidRootPart") end local function getPart(char, name) return char and char:FindFirstChild(name) end local playerList = {} local function updatePlayerList() playerList = {} for _, p in ipairs(Players:GetPlayers()) do table.insert(playerList, p) end end updatePlayerList() Players.PlayerAdded:Connect(updatePlayerList) Players.PlayerRemoving:Connect(updatePlayerList) usernameBox.FocusLost:Connect(function() local input = usernameBox.Text:lower() for _, p in ipairs(playerList) do if p.Name:lower():sub(1, #input) == input or p.DisplayName:lower():sub(1, #input) == input then usernameBox.Text = p.Name break end end end) -- === No-slip Elevator Logic === local function stickToPart(localHRP, targetPart, offsetY) -- cleanup old constraints for _, c in ipairs(localHRP:GetChildren()) do if c.Name == "ElevatorAlign" then c:Destroy() end end -- attachments local a1 = Instance.new("Attachment", localHRP) a1.Name = "ElevatorAlign" local a2 = Instance.new("Attachment", targetPart) a2.Name = "ElevatorAlignTarget" a2.Position = Vector3.new(0, offsetY, 0) -- align position local ap = Instance.new("AlignPosition", localHRP) ap.Name = "ElevatorAlign" ap.Attachment0, ap.Attachment1 = a1, a2 ap.RigidityEnabled = true ap.MaxForce = math.huge ap.Responsiveness = 200 -- align orientation local ao = Instance.new("AlignOrientation", localHRP) ao.Name = "ElevatorAlign" ao.Attachment0, ao.Attachment1 = a1, a2 ao.RigidityEnabled = true ao.MaxTorque = math.huge ao.Responsiveness = 200 end local function startPlatform(target) stopPlatform() local localHRP = getHRP(LP.Character) local targetPart = getPart(target.Character, SELECTED_PART) if not localHRP or not targetPart then warn("Missing HRP or part:", SELECTED_PART) return end local offsetY = tonumber(distBox.Text) or DIST_BELOW stickToPart(localHRP, targetPart, offsetY) end function stopPlatform() local localHRP = getHRP(LP.Character) if localHRP then for _, c in ipairs(localHRP:GetChildren()) do if c.Name == "ElevatorAlign" then c:Destroy() end end end end -- === Events === startBtn.MouseButton1Click:Connect(function() local input = usernameBox.Text for _, p in ipairs(playerList) do if p.Name == input or p.DisplayName == input then startPlatform(p) return end end warn("Player not found:", input) end) stopBtn.MouseButton1Click:Connect(stopPlatform) closeBtn.MouseButton1Click:Connect(function() stopPlatform(); gui:Destroy() end)