Advertisement
Sungmingamerpro13

MedkitScript (Break In Style)

Mar 10th, 2024
879
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.50 KB | Source Code | 0 0
  1. local Tool = script.Parent
  2. -- Create the Heal function
  3. local function Heal(player)
  4.     -- Check if the player is alive
  5.     if player.Character and player.Character:FindFirstChild("Humanoid") and player.Character.Humanoid.Health > 0 then
  6.         -- Create a selection box on the player
  7.         local selectionBox = Instance.new("SelectionBox")
  8.         selectionBox.Adornee = player.Character
  9.         selectionBox.LineThickness = 0.1
  10.         selectionBox.Parent = player.Character
  11.  
  12.         -- Wait for a short duration to show the selection box
  13.         wait(3)
  14.  
  15.         -- Heal the player
  16.         player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth
  17.  
  18.         -- Remove the selection box
  19.         selectionBox:Destroy()
  20.     end
  21. end
  22.  
  23. -- Handle equipped event
  24. Tool.Equipped:Connect(function(mouse)
  25.     -- Create a selection box for the local player
  26.     local selectionBox = Instance.new("SelectionBox")
  27.     selectionBox.Adornee = game.Players.LocalPlayer.Character
  28.     selectionBox.LineThickness = 0.1
  29.     selectionBox.Parent = game.Players.LocalPlayer.Character
  30.  
  31.     -- Wait for a short duration to show the selection box
  32.     wait(1)
  33.  
  34.     -- Remove the selection box
  35.     selectionBox:Destroy()
  36. end)
  37.  
  38. -- Handle mouse button click
  39. Tool.Activated:Connect(function()
  40.     -- Check if the player is healing themselves
  41.     local humanoid = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
  42.     if humanoid and humanoid.Health > 0 then
  43.         Heal(game.Players.LocalPlayer)
  44.         script.Parent.healed:Play()
  45.     elseif humanoid and humanoid.Health < humanoid.MaxHealth then
  46.         Tool:Destroy()
  47.     end
  48. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement