Advertisement
Idkrandomthingyyyy

if hurt then message

Oct 4th, 2023
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. getgenv().hurtmessages = {
  2. "All that you got?",
  3. "are you slow?",
  4. "cmon now",
  5. "bros the reason shampoo bottles have instructions like damn",
  6. "gg",
  7. "Black pink in your area",
  8. "joker hits the griddy and dies",
  9. "oh my days mate GG my original gangsta 'h",
  10. "normal day in chicago",
  11. "london",
  12. "cancelled you just hit a woman",
  13. "waddahel"
  14.  
  15. }
  16.  
  17. local player = game.Players.LocalPlayer
  18.  
  19. if player.Character then
  20. local humanoid = player.Character:WaitForChild("Humanoid")
  21. local previousHealth = humanoid.Health
  22.  
  23. humanoid.Changed:Connect(function()
  24. if humanoid.Health < previousHealth then
  25. local randomIndex = math.random(1, #getgenv().hurtmessages)
  26. local message = getgenv().hurtmessages[randomIndex]
  27.  
  28. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(message, "All")
  29. end
  30.  
  31. previousHealth = humanoid.Health
  32. end)
  33. end
  34.  
  35. player.CharacterAdded:Connect(function(char)
  36. local humanoid = char:WaitForChild("Humanoid")
  37. local previousHealth = humanoid.Health
  38.  
  39. humanoid.Changed:Connect(function()
  40. if humanoid.Health < previousHealth then
  41. local randomIndex = math.random(1, #getgenv().hurtmessages)
  42. local message = getgenv().hurtmessages[randomIndex]
  43.  
  44. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(message, "All")
  45. end
  46.  
  47. previousHealth = humanoid.Health
  48. end)
  49. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement