I have a anti telekill script and i want if a player stay on a teleport more than 3 seconds then the players can kill he without get any punish.
Here is the script:
I hope anyone can do it. Thanks!
telekill = {} addhook("join", "_j") addhook("kill", "_k") addhook("movetile", "_mt") function _mt(id,x,y) 	if entity(x,y,"type") == 70 then 		telekill[id] = true 		freetimer("parse","lua telekill["..id.."]=false") 		timer(3000,"parse","lua telekill["..id.."]=false") 		end end function _j(p) 	telekill[p] = false end function _k(k, v, w, x, y) 	if entity(math.floor(x/32), math.floor(y/32), "type") == 70 then 		local killTileX = math.floor(x/32) 		local killTileY = math.floor(y/32) 		if not ((player(k, "tilex") > killTileX+12) or (player(k, "tilex") < killTileX-12) or (player(k, "tiley") > killTileY+12) or (player(k, "tiley") < killTileY-12)) then 			--telekill[k] = telekill[k] + 1 			if telekill[v] then 				parse("killplayer "..k) 			end 			msg("\169255048048"..player(k, "name").." has been punished for tele-camping.") 		end 	end end
function _k(k,v,w,x,y) 	local killTileX, killTileY = math.floor(x/32), math.floor(y/32) 	if entity(killTileX,killTileY,"type") == 70 then 		if (player(k,"tilex") >= killTileX-12 and player(k,"tilex") <= killTileX+12 and player(k,"tiley") >= killTileY-12 and player(k,"tiley") <= killTileY+12) then 		-- if not ((player(k,"tilex") > killTileX+12) or (player(k,"tilex") < killTileX-12) or (player(k,"tiley") > killTileY+12) or (player(k,"tiley") < killTileY-12)) then 			-- telekill[k] = telekill[k] + 1 			if telekill[v] then 				parse("killplayer "..k) 				msg("\169255048048"..player(k, "name").." has been punished for tele-camping.") 			end 		end 	end end