Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Place this script inside a LocalScript in StarterPlayerScripts or StarterCharacterScripts
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- local Character = Player.Character or Player.CharacterAdded:Wait()
- local humanoid = Character:WaitForChild("Humanoid")
- -- Function to switch to R6 or R15
- local function switchRig(rigType)
- humanoid:ChangeRigType(rigType)
- wait(0.1) -- Wait for rig change to take effect
- Player:LoadCharacter() -- Reset character
- end
- -- Create UI
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = Player:WaitForChild("PlayerGui")
- -- Main UI Frame
- local uiFrame = Instance.new("Frame")
- uiFrame.Size = UDim2.new(0, 200, 0, 150)
- uiFrame.Position = UDim2.new(0.5, -100, 0.5, -75)
- uiFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- uiFrame.BorderSizePixel = 2
- uiFrame.BorderColor3 = Color3.fromRGB(0, 0, 0)
- uiFrame.BackgroundTransparency = 0.5
- uiFrame.AnchorPoint = Vector2.new(0.5, 0.5)
- uiFrame.Parent = screenGui
- -- Make the UI draggable
- local dragging, dragInput, dragStart, startPos
- local function updateDrag(input)
- local delta = input.Position - dragStart
- uiFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- uiFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = uiFrame.Position
- input.Changed:Connect(function()
- if dragging == false then
- input.Changed:Disconnect()
- end
- end)
- end
- end)
- uiFrame.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement then
- if dragging then
- updateDrag(input)
- end
- end
- end)
- uiFrame.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- -- R6 Button
- local r6Button = Instance.new("TextButton")
- r6Button.Size = UDim2.new(0, 180, 0, 50)
- r6Button.Position = UDim2.new(0.5, -90, 0.5, -25)
- r6Button.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- r6Button.TextColor3 = Color3.fromRGB(255, 255, 255)
- r6Button.Text = "R6"
- r6Button.BorderSizePixel = 0
- r6Button.Parent = uiFrame
- r6Button.MouseButton1Click:Connect(function()
- switchRig(Enum.HumanoidRigType.R6)
- end)
- -- R15 Button
- local r15Button = Instance.new("TextButton")
- r15Button.Size = UDim2.new(0, 180, 0, 50)
- r15Button.Position = UDim2.new(0.5, -90, 0.5, 30)
- r15Button.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- r15Button.TextColor3 = Color3.fromRGB(255, 255, 255)
- r15Button.Text = "R15"
- r15Button.BorderSizePixel = 0
- r15Button.Parent = uiFrame
- r15Button.MouseButton1Click:Connect(function()
- switchRig(Enum.HumanoidRigType.R15)
- end)
- -- Minimize/Close Button (X)
- local closeButton = Instance.new("TextButton")
- closeButton.Size = UDim2.new(0, 30, 0, 30)
- closeButton.Position = UDim2.new(1, -35, 0, -35)
- closeButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- closeButton.Text = "X"
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.BorderSizePixel = 0
- closeButton.Parent = uiFrame
- closeButton.MouseButton1Click:Connect(function()
- uiFrame.Visible = not uiFrame.Visible
- end)
- -- Minimized Icon (when UI is hidden)
- local minimizedIcon = Instance.new("TextButton")
- minimizedIcon.Size = UDim2.new(0, 50, 0, 50)
- minimizedIcon.Position = UDim2.new(0.5, -25, 0.5, -25)
- minimizedIcon.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- minimizedIcon.Text = "RIG"
- minimizedIcon.TextColor3 = Color3.fromRGB(255, 255, 255)
- minimizedIcon.BorderSizePixel = 0
- minimizedIcon.Visible = false
- minimizedIcon.Parent = screenGui
- minimizedIcon.MouseButton1Click:Connect(function()
- uiFrame.Visible = true
- minimizedIcon.Visible = false
- end)
- -- Show minimize icon when UI is hidden
- uiFrame.GetPropertyChangedSignal("Visible"):Connect(function()
- if not uiFrame.Visible then
- minimizedIcon.Visible = true
- else
- minimizedIcon.Visible = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment