Зависит от того, откуда гуманоид получает урон. Если он получает урон от LocalScript, который не поддерживает FE, то Гуманоид не получит урон.
Если вы хотите, чтобы гуманоид получил урон или мгновенно убил его, вот несколько способов:
Мгновенное убийство (из не-LocalScript)
local character = nil; -- replace nil with the character
character:BreakJoints();
Мгновенное убийство (из LocalScript)
В локальном сценарии:
local character = game:service("Players").LocalPlayer.Character -- replace this to the character. if you don't replace it, it will kill your character.
local rep = game:service("ReplicatedStorage");
local event = rep:WaitForChild("killEvent");
event:FireServer(character);
В обычном сценарии:
local rep = game:service("ReplicatedStorage");
local ev = Instance.new("RemoteEvent",rep);
ev.Name = "killEvent";
ev.OnServerEvent:connect(function(plr, char)
if not char then char = plr.Character end;
char:BreakJoints();
end);
Получение урона (из не-LocalScript)
local character = nil; -- replace nil with the character
local humanoid = character:WaitForChild("Humanoid");
local damage = 50; -- Change this to the damage you want the humanoid to take
humanoid:TakeDamage(damage);
Получение урона (из LocalScript)
В локальном сценарии:
local rep = game:service("ReplicatedStorage");
local event = rep:WaitForChild("damageEvent");
local character = game:service("Players").LocalPlayer.Character; -- replace this to the character. if you don't change it, it will automatically damage your character.
local humanoid = character:WaitForChild("Humanoid");
local damage = 50; -- Change this to the damage you want the player to take
event:FireServer(humanoid, damage);
В обычном сценарии:
local rep = game:service("ReplicatedStorage");
local event = Instance.new("RemoteEvent", rep);
event.Name = "damageEvent";
event.OnServerEvent:connect(function(player, hum, damage)
if not hum then hum = player.Character.Humanoid; end;
hum:TakeDamage(damage);
end);
Это нужно сделать, чтобы гуманоид получил урон или убил его. Вы также можете использовать эти методы, чтобы убивать других игроков, так как мы используем Remotes для местных жителей.
Надеюсь, мой ответ поможет!