April_The_Sergal

Untitled

Jan 30th, 2025
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. -- List of quirky death messages
  2. local messages = {
  3. "You tripped over a rock and died!",
  4. "A passing chicken pecked you to death.",
  5. "You forgot to breathe. Oops.",
  6. "An invisible force sent you to the void.",
  7. "You were so unlucky that you just dropped dead.",
  8. "A wandering trader scammed you to death.",
  9. "You died from extreme boredom.",
  10. "Your shoelaces were untied... and that was your downfall.",
  11. "A creeper from another dimension got you.",
  12. "You blinked too hard and perished."
  13. }
  14.  
  15. -- Select a random player within a radius (adjust range if needed)
  16. local result = commands.exec("execute as @p[distance=..5] run data get entity @s UUID")
  17.  
  18. -- If no player is found, exit
  19. if not result or result == "" then
  20. print("No player detected near the button.")
  21. return
  22. end
  23.  
  24. -- Get a random message
  25. local deathMessage = messages[math.random(#messages)]
  26.  
  27. -- Kill the player and send the quirky death message
  28. commands.exec("execute as @p[distance=..5] run kill @s")
  29. commands.exec('execute as @p[distance=..5] run title @s title {"text":"' .. deathMessage .. '","color":"red"}"')
  30.  
  31. print("Executed: " .. deathMessage)
Advertisement
Add Comment
Please, Sign In to add comment