1

# How to make players not kill each other?

I'm making a game in and I'm new to Roblox I'm having trouble finding any videos on how to do this as my players are supplied with swords in there backpack but one issue is that i want players to only be able to kill Npcs. If you can please help.

0

1

You can add value inside player name it "isPlayer" and modify sword script so that whenever they attack something, you should make it so that if there is "isPlayer" inside of them you should not damage

1

You could use :GetPlayerFromCharacter()

0
MattVSNNL 614
5 days ago
Edited 5 days ago

Hello,

I made a script that detects when a player joins, then it sets their health to INF so they can't die!

Script in ServerScriptService (not a localscript and not a modulescript)

local PlayersService = game:GetService("Players")

local humanoid = char:FindFirstChild("Humanoid")

if humanoid then

humanoid.Health = math.huge

end

end)
end)

0
i mean if they can kill the npc the npc might be able to kill the players aswell Xapelize 2326 — 4d
0
what? MattVSNNL 614 — 4d