Ovovuevuevue

Lightning strike script

Jan 12th, 2025
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local Lighting = game:GetService("Lighting")
  3. local Player = Players.LocalPlayer
  4. local HighlightedPlayer = nil
  5. local Keyword = "SHAZAM"
  6.  
  7. --
  8. local function createHighlight(targetPlayer)
  9. if not targetPlayer then return end
  10. local highlight = Instance.new("Highlight")
  11. highlight.FillColor = Color3.new(1, 1, 0) -- Yellow color
  12. highlight.FillTransparency = 0.5
  13. highlight.OutlineTransparency = 0
  14. highlight.Parent = targetPlayer.Character
  15. return highlight
  16. end
  17.  
  18. --
  19. local function removeHighlight(targetPlayer)
  20. if targetPlayer and targetPlayer.Character then
  21. for _, child in pairs(targetPlayer.Character:GetChildren()) do
  22. if child:IsA("Highlight") then
  23. child:Destroy()
  24. end
  25. end
  26. end
  27. end
  28.  
  29. --
  30. local function onChatMessage(message)
  31. if string.lower(message) == string.lower(Keyword) then
  32. -- Change sky to night
  33. Lighting.ClockTime = 20
  34.  
  35. --
  36. for _, targetPlayer in pairs(Players:GetPlayers()) do
  37. if targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
  38. --
  39. local lightning = Instance.new("Part")
  40. lightning.Size = Vector3.new(0.2, 20, 0.2)
  41. lightning.BrickColor = BrickColor.new("Bright yellow")
  42. lightning.Material = Enum.Material.Neon
  43. lightning.Anchored = true
  44. lightning.CanCollide = false
  45. lightning.CFrame = CFrame.new(
  46. targetPlayer.Character.HumanoidRootPart.Position + Vector3.new(0, 10, 0)
  47. )
  48. lightning.Parent = workspace
  49.  
  50. --
  51. local humanoid = targetPlayer.Character:FindFirstChild("Humanoid")
  52. if humanoid then
  53. humanoid:TakeDamage(60)
  54. end
  55.  
  56. -- Put the fries in the bag😡😡😡😡
  57. local sparkEffect = Instance.new("ParticleEmitter")
  58. sparkEffect.Color = ColorSequence.new(Color3.new(1, 1, 0))
  59. sparkEffect.Size = NumberSequence.new(2)
  60. sparkEffect.Lifetime = NumberRange.new(0.5)
  61. sparkEffect.Rate = 100
  62. sparkEffect.Speed = NumberRange.new(5)
  63. sparkEffect.Parent = lightning
  64.  
  65. local soundEffect = Instance.new("Sound")
  66. soundEffect.SoundId = "rbxassetid://6955233353" -- Replace with a lightning sound effect ID
  67. soundEffect.Volume = 2
  68. soundEffect.PlayOnRemove = true
  69. soundEffect.Parent = lightning
  70. soundEffect:Destroy()
  71.  
  72. --
  73. game:GetService("Debris"):AddItem(lightning, 0.5)
  74. end
  75. end
  76. end
  77. end
  78.  
  79. --
  80. local function highlightRandomPlayer()
  81. if HighlightedPlayer then
  82. removeHighlight(HighlightedPlayer)
  83. end
  84. local players = Players:GetPlayers()
  85. if #players > 1 then
  86. local randomPlayer
  87. repeat
  88. randomPlayer = players[math.random(1, #players)]
  89. until randomPlayer ~= Player
  90. HighlightedPlayer = randomPlayer
  91. createHighlight(randomPlayer)
  92. end
  93. end
  94.  
  95. --
  96. Player.Chatted:Connect(onChatMessage)
  97.  
  98. -- Run the highlight function every 5 seconds
  99. while true do
  100. highlightRandomPlayer()
  101. wait(5)
  102. end
  103.  
Advertisement
Add Comment
Please, Sign In to add comment