Advertisement
hacimiks

fe sit

Apr 11th, 2024 (edited)
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.66 KB | None | 0 0
  1. -- Create a ScreenGui object to hold the draggable GUI
  2. local gui = Instance.new("ScreenGui")
  3. gui.Name = "DraggableGui"
  4. gui.Parent = game.CoreGui
  5.  
  6. -- Create a Frame object to hold the text label and button
  7. local frame = Instance.new("Frame")
  8. frame.Name = "DraggableFrame"
  9. frame.Size = UDim2.new(0, 150, 0, 60)
  10. frame.Position = UDim2.new(0.5, -75, 0.5, -30)
  11. frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  12. frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  13. frame.BackgroundTransparency = 0
  14. frame.Active = true
  15. frame.Draggable = true
  16. frame.Parent = gui
  17.  
  18. -- Create a TextLabel object to show the text
  19. local textLabel = Instance.new("TextLabel")
  20. textLabel.Name = "TextLabel"
  21. textLabel.Size = UDim2.new(1, 0, 0.5, 0)
  22. textLabel.Position = UDim2.new(0, 0, 0, 0)
  23. textLabel.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  24. textLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
  25. textLabel.BackgroundTransparency = 0
  26. textLabel.Text = "RemiAPE | by aoki0x"
  27. textLabel.Font = Enum.Font.SourceSans
  28. textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  29. textLabel.TextSize = 18
  30. textLabel.Parent = frame
  31.  
  32. -- Create a TextButton object to act as the "SIT" button
  33. local sitButton = Instance.new("TextButton")
  34. sitButton.Name = "SitButton"
  35. sitButton.Size = UDim2.new(1, 0, 0.5, 0)
  36. sitButton.Position = UDim2.new(0, 0, 0.5, 0)
  37. sitButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  38. sitButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
  39. sitButton.BackgroundTransparency = 0
  40. sitButton.Text = "Toggle Sit"
  41. sitButton.Font = Enum.Font.SourceSansBold
  42. sitButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  43. sitButton.TextSize = 18
  44. sitButton.Parent = frame
  45.  
  46. -- Define a function to make the player character sit
  47. local function sit()
  48.     local character = game.Players.LocalPlayer.Character
  49.     if character then
  50.         local humanoid = character:FindFirstChildOfClass("Humanoid")
  51.         if humanoid then
  52.             humanoid.Sit = true
  53.         end
  54.     end
  55. end
  56.  
  57. -- Define a function to make the player character stand up
  58. local function standUp()
  59.     local character = game.Players.LocalPlayer.Character
  60.     if character then
  61.         local humanoid = character:FindFirstChildOfClass("Humanoid")
  62.         if humanoid then
  63.             humanoid.Sit = false
  64.         end
  65.     end
  66. end
  67.  
  68. -- Connect the SitButton to the sit() function
  69. sitButton.MouseButton1Click:Connect(function()
  70.     sit()
  71. end)
  72.  
  73. -- Connect the Humanoid.Jumping event to the standUp() function
  74. game.Players.LocalPlayer.CharacterAdded:Connect(function(character)
  75.     local humanoid = character:FindFirstChildOfClass("Humanoid")
  76.     if humanoid then
  77.         humanoid.Jumping:Connect(function()
  78.             standUp()
  79.         end)
  80.     end
  81. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement