Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local Lighting = game:GetService("Lighting")
- local Player = Players.LocalPlayer
- local HighlightedPlayer = nil
- local Keyword = "SHAZAM"
- --
- local function createHighlight(targetPlayer)
- if not targetPlayer then return end
- local highlight = Instance.new("Highlight")
- highlight.FillColor = Color3.new(1, 1, 0) -- Yellow color
- highlight.FillTransparency = 0.5
- highlight.OutlineTransparency = 0
- highlight.Parent = targetPlayer.Character
- return highlight
- end
- --
- local function removeHighlight(targetPlayer)
- if targetPlayer and targetPlayer.Character then
- for _, child in pairs(targetPlayer.Character:GetChildren()) do
- if child:IsA("Highlight") then
- child:Destroy()
- end
- end
- end
- end
- --
- local function onChatMessage(message)
- if string.lower(message) == string.lower(Keyword) then
- -- Change sky to night
- Lighting.ClockTime = 20
- --
- for _, targetPlayer in pairs(Players:GetPlayers()) do
- if targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
- --
- local lightning = Instance.new("Part")
- lightning.Size = Vector3.new(0.2, 20, 0.2)
- lightning.BrickColor = BrickColor.new("Bright yellow")
- lightning.Material = Enum.Material.Neon
- lightning.Anchored = true
- lightning.CanCollide = false
- lightning.CFrame = CFrame.new(
- targetPlayer.Character.HumanoidRootPart.Position + Vector3.new(0, 10, 0)
- )
- lightning.Parent = workspace
- --
- local humanoid = targetPlayer.Character:FindFirstChild("Humanoid")
- if humanoid then
- humanoid:TakeDamage(60)
- end
- -- Put the fries in the bag😡😡😡😡
- local sparkEffect = Instance.new("ParticleEmitter")
- sparkEffect.Color = ColorSequence.new(Color3.new(1, 1, 0))
- sparkEffect.Size = NumberSequence.new(2)
- sparkEffect.Lifetime = NumberRange.new(0.5)
- sparkEffect.Rate = 100
- sparkEffect.Speed = NumberRange.new(5)
- sparkEffect.Parent = lightning
- local soundEffect = Instance.new("Sound")
- soundEffect.SoundId = "rbxassetid://6955233353" -- Replace with a lightning sound effect ID
- soundEffect.Volume = 2
- soundEffect.PlayOnRemove = true
- soundEffect.Parent = lightning
- soundEffect:Destroy()
- --
- game:GetService("Debris"):AddItem(lightning, 0.5)
- end
- end
- end
- end
- --
- local function highlightRandomPlayer()
- if HighlightedPlayer then
- removeHighlight(HighlightedPlayer)
- end
- local players = Players:GetPlayers()
- if #players > 1 then
- local randomPlayer
- repeat
- randomPlayer = players[math.random(1, #players)]
- until randomPlayer ~= Player
- HighlightedPlayer = randomPlayer
- createHighlight(randomPlayer)
- end
- end
- --
- Player.Chatted:Connect(onChatMessage)
- -- Run the highlight function every 5 seconds
- while true do
- highlightRandomPlayer()
- wait(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment