CreateChat "!god" "" (25) [[
	USERTEMP[id]["god"] = not USERTEMP[id]["god"]
]]

CreateChat "!togglegod" "<id>" (25) [[
	local p = tonumber(s[2])
	if p and player(p,"exists") then
		if USERTEMP[p]["god"] then
			USERTEMP[p]["god"] = nil
			msgc2(id, "You took god mode from "..player(p,"name"), 255, 0, 0)
		else
			USERTEMP[p]["god"] = true
			msgc2(id, "You gave god mode to "..player(p,"name"), 0, 255, 0)
		end
	end
]]

function HitPlayer(id,dmg)
	if not USERTEMP[id]["god"] then
		parse("sethealth "..id.." "..player(id,"health")-dmg)
		Sound3("player/hit"..math.random(1,3)..".wav", player(id,"x"), player(id,"y"), 380)
	end
end

function godhit(id)
	if USERTEMP[id]["god"] then
		return 1
	end
end
CreateHitAttachment(godhit)