Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a model not take damage?

I don't know how to make a model not take damage because I don't want others to kill the model. I tried adding a invisible wall but you still could kill it and i tried this script which also didn't work:

while true do
local npc = game.Workspace.NathanToh2 
local respawnPos = (-227.7, -12.9, 23.7) 
if npc.Health == 0 then
npc.Position = Vector3.new(respawnPos)
end
end

1 answer

✓ Accepted answer
game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(npc)
		if npc.Name == "Nathantoh2" then
			repeat wait() until npc.Humanoid.Health == 0
			local respawnPos = Vector3.new(-227.7, -12.9, 23.7)
			plr.CharacterAdded:Connect(function()
				repeat wait() until plr.Character ~= nil
				local char = plr.Character
				char:MoveTo(respawnPos)
			end)
		end
	end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.