Advertisement
Guest User

Murder vs sheriff made by DD

a guest
Sep 11th, 2024
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. -- Function to expand hitbox
  2. local function expandHitbox(player)
  3. if player ~= game.Players.LocalPlayer then
  4. local head = player.Character:FindFirstChild("Head")
  5. if head then
  6. head.Size = Vector3.new(100, 100, 100)
  7. head.Transparency = 0.5
  8. head.CanCollide = false
  9. end
  10. end
  11. end
  12.  
  13. -- Function to toggle hitbox expansion
  14. local hitboxExpanded = false
  15. local function toggleHitboxExpansion()
  16. hitboxExpanded = not hitboxExpanded
  17. for _, player in pairs(game:GetService("Players"):GetPlayers()) do
  18. if player.Character then
  19. expandHitbox(player)
  20. end
  21. end
  22. end
  23.  
  24. -- Create the ScreenGui
  25. local player = game.Players.LocalPlayer
  26. local screenGui = Instance.new("ScreenGui")
  27. screenGui.Name = "HitboxScreenGui"
  28. screenGui.ResetOnSpawn = false -- Ensure the GUI doesn't reset on respawn
  29. screenGui.Parent = player:WaitForChild("PlayerGui")
  30.  
  31. -- Create the toggle button in the top-left of the screen
  32. local toggleButton = Instance.new("TextButton")
  33. toggleButton.Size = UDim2.new(0, 150, 0, 50)
  34. toggleButton.Position = UDim2.new(0, 10, 0, 10) -- Top-left position
  35. toggleButton.Text = "Toggle Hitbox Size"
  36. toggleButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  37. toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  38. toggleButton.Parent = screenGui
  39.  
  40. -- Flag to check if text has been shown
  41. local textShown = false
  42.  
  43. -- Function to show text on screen
  44. local function showText()
  45. if not textShown then
  46. textShown = true
  47. local textLabel = Instance.new("TextLabel")
  48. textLabel.Size = UDim2.new(0, 300, 0, 50)
  49. textLabel.Position = UDim2.new(0.5, -150, 0, 10) -- Center top position
  50. textLabel.Text = "THIS SCRIPT IS MADE BY DD"
  51. textLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  52. textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  53. textLabel.Parent = screenGui
  54.  
  55. -- Remove the text after 5 seconds
  56. wait(5)
  57. textLabel:Destroy()
  58. end
  59. end
  60.  
  61. -- Toggle hitbox size on button click
  62. toggleButton.MouseButton1Click:Connect(function()
  63. toggleHitboxExpansion()
  64. if hitboxExpanded then
  65. toggleButton.Text = "Hitbox ON"
  66. else
  67. toggleButton.Text = "Hitbox OFF"
  68. end
  69. showText() -- Show the text when the button is clicked
  70. end)
  71.  
  72. -- Apply hitbox expander to new players
  73. game:GetService("Players").PlayerAdded:Connect(function(player)
  74. player.CharacterAdded:Connect(function(character)
  75. if hitboxExpanded then
  76. expandHitbox(player)
  77. end
  78. end)
  79. end)
  80.  
  81. -- Ensure the GUI stays when the player respawns
  82. player.CharacterAdded:Connect(function()
  83. toggleButton.Parent = player:WaitForChild("PlayerGui"):WaitForChild("HitboxScreenGui")
  84. end)
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement