Hi, I am trying to figure out how to make a script that blasts the person closest to you. So far I have not gotten any luck trying to figure out how to attack the nearest person.
This is what I have got:
local player = game.Players.LocalPlayer
character = player.CharacterAdded:wait()
local humanoid = character.HumanoidRootPart
local health = character.Humanoid
local mouse = player:GetMouse()
mouse.KeyDown:connect(function(key)
if key == "f" then --Ignore this power--
game:GetService("Chat"):Chat(player.Character.Head, "SPIRIT WALK!","Green")
humanoid.Size = Vector3.new(2,1,1)
humanoid.Transparency = 0.5
humanoid.CanCollide = false
player.PlayerGui.Timer.TextLabel.Visible = true
wait(1)
player.PlayerGui.Timer.TextLabel.Text = ("4")
wait(1)
player.PlayerGui.Timer.TextLabel.Text = ("3")
wait(1)
player.PlayerGui.Timer.TextLabel.Text = ("2")
wait(1)
player.PlayerGui.Timer.TextLabel.Text = ("1")
wait(1)
player.PlayerGui.Timer.TextLabel.Visible = false
health.Health = 0
elseif key == "e" then --this is the power I am stuck on!--
end
end)
Thank you for the help

3 comments
Those are actually Parenthesis, not brackets. These are brackets [], these are Parenthesis (), and these are Braces {}.
where i live they’re called brackets
oh, ok but umm I have a question. Whats the difference between Parenthesis and Brackets, in scripting?