Advertisement
PpRoStOo

Blade Ball free abilities

Sep 9th, 2023
73,214
4
Never
6
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 5 1
  1. local localPlayer = game.Players.LocalPlayer
  2. local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
  3. local abilitiesFolder = character:WaitForChild("Abilities")
  4.  
  5. local ChosenAbility = "Raging Deflection"
  6.  
  7. local function createGUI()
  8. local screenGui = Instance.new("ScreenGui")
  9. screenGui.Name = "AbilityChooser"
  10. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  11.  
  12. local frame = Instance.new("Frame")
  13. frame.Size = UDim2.new(0, 200, 0, 250)
  14. frame.Position = UDim2.new(0.5, -100, 0.5, -125)
  15. frame.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
  16. frame.BorderSizePixel = 0
  17. frame.Parent = screenGui
  18.  
  19. local isDragging = false
  20. local dragInput
  21. local dragStart
  22. local startPos
  23.  
  24. local function update(input)
  25. local delta = input.Position - dragStart
  26. frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  27. end
  28.  
  29. frame.InputBegan:Connect(function(input)
  30. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  31. isDragging = true
  32. dragStart = input.Position
  33. startPos = frame.Position
  34.  
  35. input.Changed:Connect(function()
  36. if input.UserInputState == Enum.UserInputState.End then
  37. isDragging = false
  38. end
  39. end)
  40. end
  41. end)
  42.  
  43. frame.InputChanged:Connect(function(input)
  44. if input.UserInputType == Enum.UserInputType.MouseMovement then
  45. dragInput = input
  46. end
  47. end)
  48.  
  49. game:GetService("UserInputService").InputChanged:Connect(function(input)
  50. if input == dragInput and isDragging then
  51. update(input)
  52. end
  53. end)
  54.  
  55. local abilities = {"Dash", "Forcefield", "Invisibility", "Platform", "Raging Deflection", "Shadow Step", "Super Jump", "Telekinesis", "Thunder Dash"}
  56. local buttonHeight = 20
  57. for i, ability in ipairs(abilities) do
  58. local button = Instance.new("TextButton")
  59. button.Size = UDim2.new(1, 0, 0, buttonHeight)
  60. button.Position = UDim2.new(0, 0, 0, (i - 1) * (buttonHeight + 5))
  61. button.Text = ability
  62. button.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8)
  63. button.BorderColor3 = Color3.new(1, 1, 1)
  64. button.Parent = frame
  65.  
  66. button.MouseButton1Click:Connect(function()
  67. ChosenAbility = ability
  68. end)
  69. end
  70. end
  71.  
  72. local function onCharacterAdded(newCharacter)
  73. character = newCharacter
  74. abilitiesFolder = character:WaitForChild("Abilities")
  75. createGUI()
  76. end
  77.  
  78. localPlayer.CharacterAdded:Connect(onCharacterAdded)
  79. createGUI()
  80.  
  81. while task.wait() do
  82. for _, obj in pairs(abilitiesFolder:GetChildren()) do
  83. if obj:IsA("LocalScript") then
  84. if obj.Name == ChosenAbility then
  85. obj.Disabled = false
  86. else
  87. obj.Disabled = true
  88. end
  89. end
  90. end
  91. end
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement