Как добавить оповещения при убийстве NPC

Опубликовано: 15 Апрель 2026
на канале: Savchenap
826
33

#роблокс #роблокскоды #robloxedit

Простой способ работы со звуками и элементами ScreenGUI (надписями) при убийстве NPC в Roblox Studio

---- Script в NPC --
local Humanoid = script.Parent.Humanoid

function Frag()
local Val = Humanoid:FindFirstChild("creator") and Humanoid.creator.Value
if Val then
script.Parent["Screaming Monster Roar"]:Play()
game.ReplicatedStorage.KillEvent:FireClient(Val)
script:Remove()
end
end
Humanoid.Died:connect(Frag)

---- LocalScript в Frame --
game.ReplicatedStorage.KillEvent.OnClientEvent:Connect(function()
script.Parent.Visible = true
wait(2)
script.Parent.Visible = false
end)