I really don't know how I can disable PVP on my game. I really don't want any PVP at all. That means that explosions caused by players cannot hurt other players. I've tried searching everywhere on the internet but I really cannot find anything.
Is it possible that I could put something like this in my 'sword' weapon?
local sword = game.Workspace:FindFirstChild("Sword")
if sword then
local humanoid = game.Workspace:FindFirstChild("Humanoid")
humanoid.Touched:connect(function(disable)
--I don't know what I have to do!--
end)
end
I'm really not sure whether this whole script is even correct. I'm new to scripting so please, please understand me. Please check if that script is correct and please tell me what I have to add to the script.

1 comment
Add a check to see if what the sword hit is a player or not.