Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Attempt to load the Orion Library
- local success, OrionLib = pcall(function()
- return loadstring(game:HttpGet('https://raw.githubusercontent.com/shlexware/Orion/main/source'))()
- end)
- -- Check if the library loaded successfully
- if not success then
- warn("Failed to load Orion Library: " .. tostring(OrionLib))
- return -- Exit if loading failed
- end
- -- Create the main window
- local Window = OrionLib:MakeWindow({
- Name = "Unanchored Parts Controller",
- HidePremium = false,
- SaveConfig = true,
- ConfigFolder = "UnanchoredPartsConfig"
- })
- -- Create a section for unanchored parts control
- local UnanchoredPartsControlSection = Window:MakeSection({
- Name = "Unanchored Parts Control",
- })
- -- Function to get all unanchored parts
- local function getUnanchoredParts()
- local parts = {}
- for _, v in pairs(workspace:GetDescendants()) do
- if v:IsA("BasePart") and not v.Anchored and not v:IsDescendantOf(Players.LocalPlayer.Character) then
- table.insert(parts, v)
- end
- end
- return parts
- end
- -- Function to arrange parts at a specific position
- local function arrangeParts(parts, position)
- for _, part in ipairs(parts) do
- part.CFrame = position
- end
- end
- -- Button to bring unanchored parts to the player's right arm as a gun
- UnanchoredPartsControlSection:CreateButton({
- Name = "Gun",
- Callback = function()
- local character = Players.LocalPlayer.Character
- if character and character:FindFirstChild("Right Arm") then
- local rightArm = character["Right Arm"]
- local parts = getUnanchoredParts()
- arrangeParts(parts, rightArm.CFrame * CFrame.new(0, -1, -2)) -- Adjust position as needed
- end
- end,
- })
- -- Button to bring unanchored parts above the player's head as a hand
- UnanchoredPartsControlSection:CreateButton({
- Name = "Hand",
- Callback = function()
- local character = Players.LocalPlayer.Character
- if character and character:FindFirstChild("Head") then
- local head = character.Head
- local parts = getUnanchoredParts()
- arrangeParts(parts, head.CFrame * CFrame.new(0, 3, 0)) -- Adjust position as needed
- end
- end,
- })
- -- Button to bring unanchored parts above the player's head as their username representation
- UnanchoredPartsControlSection:CreateButton({
- Name = "Your User",
- Callback = function()
- local character = Players.LocalPlayer.Character
- if character and character:FindFirstChild("Head") then
- local head = character.Head
- local parts = getUnanchoredParts()
- arrangeParts(parts, head.CFrame * CFrame.new(0, 5, 0)) -- Adjust position as needed for username representation
- end
- end,
- })
- -- Button to bring unanchored parts into the player's arm like holding a phone
- UnanchoredPartsControlSection:CreateButton({
- Name = "Phone",
- Callback = function()
- local character = Players.LocalPlayer.Character
- if character and character:FindFirstChild("Right Arm") then
- local rightArm = character["Right Arm"]
- local parts = getUnanchoredParts()
- arrangeParts(parts, rightArm.CFrame * CFrame.new(0, -0.5, -1)) -- Adjust position as needed for phone representation
- end
- end,
- })
- -- Initialize the library (required)
- OrionLib:Init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement