local punchEvent = game.ReplicatedStorage:WaitForChild("PunchEvent") local damageAmount = 10 local function onPunch(player) local character = player.Character if character then local humanoid = character:FindFirstChild("Humanoid") if humanoid then for _, target in pairs(workspace:GetDescendants()) do if target:IsA("Model") and target ~= character then local targetHumanoid = target:FindFirstChild("Humanoid") if targetHumanoid then targetHumanoid:TakeDamage(damageAmount) end end end end end end punchEvent.OnServerEvent:Connect(onPunch)
- local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Workspace = game:GetService("Workspace") -- local punchEvent = ReplicatedStorage:WaitForChild("PunchEvent") -- punchEvent.OnServerEvent:Connect(function(player, damage) local character = player.Character if character then local origin = character:FindFirstChild("HumanoidRootPart").Position local radius = 5 -- -- for _, obj in pairs(Workspace:GetDescendants()) do -- Check if the object has a HumanoidRootPart and a Humanoid local humanoidRootPart = obj:FindFirstChild("HumanoidRootPart") local humanoid = obj:FindFirstChild("Humanoid") if humanoidRootPart and humanoid then local distance = (origin - humanoidRootPart.Position).Magnitude if distance
local punchEvent = game.ReplicatedStorage:WaitForChild("PunchEvent") local damageAmount = 10 local function onPunch(player) local character = player.Character if character then local humanoid = character:FindFirstChild("Humanoid") if humanoid then for _, target in pairs(workspace:GetDescendants()) do if target:IsA("Model") and target ~= character then local targetHumanoid = target:FindFirstChild("Humanoid") if targetHumanoid then targetHumanoid:TakeDamage(damageAmount) end end end end end end punchEvent.OnServerEvent:Connect(onPunch)
Hey, this works well and I like it, but the range is quite extensive. It's so far-reaching that it affects everyone in the server. Could you create a tutorial on how to adjust that?
player.CharacterToca un clip para pegarlo en el cuadro de texto.local punchEvent = game.ReplicatedStorage:WaitForChild("PunchEvent") local damageAmount = 10 local function onPunch(player) local character = player.Character if character then local humanoid = character:FindFirstChild("Humanoid") if humanoid then for _, target in pairs(workspace:GetDescendants()) do if target:IsA("Model") and target ~= character then local targetHumanoid = target:FindFirstChild("Humanoid") if targetHumanoid then targetHumanoid:TakeDamage(damageAmount) end end end end end end punchEvent.OnServerEvent:Connect(onPunch)
local punchEvent = game.ReplicatedStorage:WaitForChild("PunchEvent")
local damageAmount = 10
local function onPunch(player)
local character = player.Character
if character then
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
for _, target in pairs(workspace:GetDescendants()) do
if target:IsA("Model") and target ~= character then
local targetHumanoid = target:FindFirstChild("Humanoid")
if targetHumanoid then
targetHumanoid:TakeDamage(damageAmount)
end
end
end
end
end
end
punchEvent.OnServerEvent:Connect(onPunch)
Are you telling the truth?
That dont work to me:/
-
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace") --
local punchEvent = ReplicatedStorage:WaitForChild("PunchEvent")
--
punchEvent.OnServerEvent:Connect(function(player, damage)
local character = player.Character
if character then
local origin = character:FindFirstChild("HumanoidRootPart").Position
local radius = 5 --
--
for _, obj in pairs(Workspace:GetDescendants()) do
-- Check if the object has a HumanoidRootPart and a Humanoid
local humanoidRootPart = obj:FindFirstChild("HumanoidRootPart")
local humanoid = obj:FindFirstChild("Humanoid")
if humanoidRootPart and humanoid then
local distance = (origin - humanoidRootPart.Position).Magnitude
if distance
local punchEvent = game.ReplicatedStorage:WaitForChild("PunchEvent")
local damageAmount = 10
local function onPunch(player)
local character = player.Character
if character then
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
for _, target in pairs(workspace:GetDescendants()) do
if target:IsA("Model") and target ~= character then
local targetHumanoid = target:FindFirstChild("Humanoid")
if targetHumanoid then
targetHumanoid:TakeDamage(damageAmount)
end
end
end
end
end
end
punchEvent.OnServerEvent:Connect(onPunch)
/copy
Credit to kuro the dev
Hey, this works well and I like it, but the range is quite extensive. It's so far-reaching that it affects everyone in the server. Could you create a tutorial on how to adjust that?
Bro how can u tye r6 script??
can u make a tut on how to make a health bar?
someone help me pls, I’m in iPhone and every time I try to put on the api key a black screen covers the game and I don’t see anything
I can turn your phone sideways then copy and paste unless you have updated Roblox you can auto magically publish without copy and pasting api key
Everything is fine but damage not workin
yeah
bro not working
for this i waste my 1 hour
is this works on PC??
Only The Button
How to create a game on my android
you cant unless you use studio lite you can replace starter place
It wont publish
Where's the r6 script?
punchEvent
PunchEvent
@@AbxStudiozyo tutorial how to copy script? i'm still confused
@@icz-editz yes
Omg mobile what !
RemoteEvent
android?
Nice job lil bro
I can’t find screen gui
player.CharacterToca un clip para pegarlo en el cuadro de texto.local punchEvent = game.ReplicatedStorage:WaitForChild("PunchEvent")
local damageAmount = 10
local function onPunch(player)
local character = player.Character
if character then
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
for _, target in pairs(workspace:GetDescendants()) do
if target:IsA("Model") and target ~= character then
local targetHumanoid = target:FindFirstChild("Humanoid")
if targetHumanoid then
targetHumanoid:TakeDamage(damageAmount)
end
end
end
end
end
end
punchEvent.OnServerEvent:Connect(onPunch)
/copy