When a guyz level +60
Reset level For add a new itemsin his inventory and forkick him automaticly
Please help me
-Thanks
[593] = { name = "Crystall Sword", desc = "Crystall Sword is used for killing dangerious beasts.", r = 180, g = 0, b = 0, action = {"equip","cast"}, slot = 3, eimage = "gfx/weiwen/Crabby/ArmourWeapon/Crystalline_Sword.png", fimage = "gfx/weiwen/Crabby/ArmourWeapon/Crystalline_Sword.png", offsetx = 6, offsety = 17, atk = 2.0, speed = 0.25, level = 30, func = equip,{ 		function(id,itemslot,itemid,equip) if PLAYERS[id].MP < 20 then message(id, "You don't have enough mana",'255255255') return end if PLAYERS[id].Level < 30 then message(id, "You need to be level 20.","255255255") return end radiusmsg(player(id,"name") .. " used special attack.", player(id,"x"), player(id,"y")) explosion(player(id, "x"), player(id,"y"), 64, 20, id) local pos = player(id,"x") .. " " .. player(id,"y") parse("effect \"colorsmoke\" " .. pos .. " 100 96 128 128 0") 			PLAYERS[id].MP = PLAYERS[id].MP - 20 updateHUD(id) 		end,equip},	 	},
[593] = { name = "Crystall Sword", desc = "Crystall Sword is used for killing dangerious beasts.", r = 180, g = 0, b = 0, action = {"equip","cast"}, slot = 3, eimage = "gfx/weiwen/Crabby/ArmourWeapon/Crystalline_Sword.png", fimage = "gfx/weiwen/Crabby/ArmourWeapon/Crystalline_Sword.png", offsetx = 6, offsety = 17, atk = 2.0, speed = 0.25, level = 30, func = equip,{ 		function(id,itemslot,itemid,equip) if PLAYERS[id].Mana < 20 then message(id, "You don't have enough mana",'255255255') return end if PLAYERS[id].Level < 30 then message(id, "You need to be level 20.","255255255") return end radiusmsg(player(id,"name") .. " used special attack.", player(id,"x"), player(id,"y")) explosion(player(id, "x"), player(id,"y"), 64, 20, id) local pos = player(id,"x") .. " " .. player(id,"y") parse("effect \"colorsmoke\" " .. pos .. " 100 96 128 128 0") 			PLAYERS[id].Mana = PLAYERS[id].MP - 20 updateHUD(id) 		end,equip},	 	},
[593] = { name = "Crystall Sword", desc = "Crystall Sword is used for killing dangerious beasts.", r = 180, g = 0, b = 0, action = {"equip","cast"}, slot = 3, eimage = "gfx/weiwen/Crabby/ArmourWeapon/Crystalline_Sword.png", fimage = "gfx/weiwen/Crabby/ArmourWeapon/Crystalline_Sword.png", offsetx = 6, offsety = 17, atk = 2.0, speed = 0.25, level = 30, func = {equip, function(id, itemslot, itemid, equip) if PLAYERS[id].Mana >= 20 then radiusmsg(player(id,"name") .. " used special attack.", player(id,"x"), player(id,"y")) explosion(player(id, "x"), player(id,"y"), 64, 20, id) local pos = player(id,"x") .. " " .. player(id,"y") parse("effect \"colorsmoke\" " .. pos .. " 100 96 128 128 0") else message(id, "You don't have enough mana") updateHUD(id) end end}, },
addhook("ms100","atk") function atk() for id = 1,32 do if player(id,"exists") and PLAYERS[id] then parse('hudtxt2 '..id..' 11 "©255255000 '..PLAYERS[id].tmp.atk..' " 470 437 1') parse('hudtxt2 '..id..' 12 "©255255000 '..PLAYERS[id].tmp.def..' " 470 425 1') parse('hudtxt2 '..id..' 13 "©255255000 '..PLAYERS[id].tmp.spd..' " 470 410 1') parse('hudtxt2 '..id..' 14 "©255255255 Atack " 420 437 1') parse('hudtxt2 '..id..' 15 "©255255255 Defence " 420 425 1') parse('hudtxt2 '..id..' 16 "©255255255 Speed " 420 410 1') end end end
function Monster:damage(id, dmg, wpntype) if not PLAYERS[id].Tutorial.damagem then message(id, "You have attacked a monster! Good job! Keep on attacking it until it dies.", "255128000") PLAYERS[id].Tutorial.damagem = true end local wpnName if wpntype == 251 then wpnName = 'rune' elseif wpntype == 46 then wpnName = 'firewave' dmg = dmg/5 else wpnName = PLAYERS[id].Equipment[3] and ITEMS[PLAYERS[id].Equipment[3]].name or 'dagger' end self.health = self.health - dmg hudtxt2(id,41, 'Dealt '..dmg..' damage, '..self.health..' health left.', '255255255', 200,250,0) print(player(id, 'name') .. ' deals ' .. dmg .. ' damage to ' .. self.name .. ' usng a ' .. wpnName .. '.') if self.health <= 0 then if not PLAYERS[id].Tutorial.killm then message(id, "Congratulation! You have killed your first monster. You can proceed to pick up the loot by using the drop weapon button (default G)", "255128000") PLAYERS[id].Tutorial.killm = true end addexp(id, math.floor(self.exp*CONFIG.EXPRATE)) self:die() else parse('effect "colorsmoke" ' .. self.x .. ' ' .. self.y .. ' 0 ' .. self.scaley .. ' ' .. (self.r and (self.r .. ' ' .. self.g .. ' ' .. self.b) or '192 0 0')) end radiussound("weapons/machete_hit.wav", self.x, self.y) return true end
function adminCommands(id,words) 	if isAdmin(id) and words:sub(1,1) =='!' then 		local command = words:lower():sub(2,2) 		if words:sub(3,3) ~= ' ' and #words ~= 2 then return end 		print(player(id,'name')..' used a command:'..words) 		if command =='a' then 			local distance = tonumber(words:sub(4)) 			if distance then 				local rot = math.rad(player(id,'rot')-180) 				local x, y = -math.sin(rot)*distance*32, math.cos(rot)*distance*32 				parse('setpos '..id..' '..player(id,'x')+x..' '..player(id,'y')+y) 			else 				msg2(id,'Teleport forward: "!a <distance>"') 			end 			return 1 		elseif command =='b' then 			msg('©255100100'..player(id,'name')..' : '..words:sub(4)..'@C') 			return 1 		elseif command =='c' then 			local target = tonumber(words:sub(4)) 			if target then 				if player(target,'exists') then 					if target == id then 						msg2(id,'You may not teleport to yourself!') 					end 					parse('setpos '..target..' '..player(id,'x')..' '..player(id,'y')) 					return 1 				end 			end 			msg2(id,'Teleport player to you: "!c <targetid>"') 			return 1 		elseif command =='d' then 			msg('©255100100'..words:sub(4)..'@C') 			return 1 		elseif command =='e' then 			local dmg = tonumber(words:sub(4)) 			if dmg then 				parse('explosion '..player(id,'x')..' '..player(id,'y')..' '..dmg..' '..dmg..' '..id) 				return 1 			end 			msg2(id,'Spawn explosion: "!e <dmg>"') 			return 1 		elseif command =='i' then 			local itemid = tonumber(words:sub(4)) 			if itemid then 				additem(id,itemid) 				return 1 			end 			msg2(id,'Spawn item: "!i <itemid>"') 			return 1 		elseif command =='h' then 			local s = words:find(' ',4) 			local target = tonumber(words:sub(4,s)) 			if target then 				if player(target,'exists') then 					local heal = s and tonumber(words:sub(s+1,words:find(' ',s+1))) or nil 					if heal then 						parse('explosion '..player(target,'x')..' '..player(target,'y')..' 1 '..(-heal)) 						return 1 					end 				end 			end 			msg2(id,'Heal player: "!h <targetid> <amount>"') 			return 1 		elseif command =='l' then 			local script = words:sub(4) 			if script then 				msg2(id,tostring(assert(loadstring(script))() or 'done!')) 				return 			end 			msg2(id,'Run lua script: "!l <script>"') 			return 1 		elseif command =='m' then 			if gettile(player(id, 'tilex'), player(id, 'tiley')).SAFE then 				msg2(id,'You may not spawn a mosnter in a safe zone.') 				return 1 			end 			local name = words:sub(4) 			if name then 				for i, v in pairs(CONFIG.MONSTERS) do 					if v.name:lower() == name:lower() then 						local m = deepcopy(v) 						m.x, m.y = player(id, 'x'), player(id, 'y') 						Monster:new(m) 						msg2(id,'Monster ' .. name .. ' spawned.') 						return 1 					end 				end 			end 			msg2(id,'Monster ' .. name .. ' does not exist.') 			return 1 		elseif command =='n' then 			msg2(id,'{'..player(id,'tilex')*32+16 ..', '..player(id,'tiley')*32+16 ..'}') 			return 1 		elseif command =='o' then 			msg2(id,'{'..player(id,'tilex')..', '..player(id,'tiley')..'}') 			return 1 		elseif command =='p' then 			msg2(id,'{'..player(id,'x')..', '..player(id,'y')..'}') 			return 1 		elseif command =='q' then 			local length = tonumber(words:sub(3)) 			if length then 				length = math.min(length*50,250) 				for _, id in ipairs(player(0,'table')) do 					parse('shake '..id..' '..length) 				end 				for i = 1, 6 do 					if math.random(0,1) == 1 then 						parse('sv_sound weapons/explode'..i..'.wav') 					end 				end 			else 				msg2(id,'Earthquake: "!q <length in seconds, max 5>"') 			end 			return 1 		elseif command =='s' then 			local s = words:find(' ',4) 			local target = tonumber(words:sub(4,s)) 			if target then 				if player(target,'exists') then 					local speed = s and tonumber(words:sub(s+1,words:find(' ',s+1))) or nil 					if speed then 						parse('speedmod '..target..' '..speed) 						return 1 					end 				end 			end 			msg2(id,'Speed modifier: "!s <targetid> <speedmod, between -100 and 100>"') 			return 1 		elseif command =='t' then 			local target = tonumber(words:sub(3)) 			if target then 				if player(target,'exists') then 					if target == id then 						msg2(id,'You may not teleport to yourself!') 					end 					parse('setpos '..id..' '..player(target,'x')..' '..player(target,'y')) 					return 1 				end 			end 			msg2(id,'Teleport to player: "!t <targetid>"') 			return 1 		elseif command =='u' then 			local delay = tonumber(words:sub(3)) or 0 			shutdown(delay*1000) 			return 1 		elseif command =='v' then 			saveserver() 			msg2(id,'Saved server!') 			return 1 			elseif command =='g' then if PLAYERS[id].tmp.god ~= 1 then PLAYERS[id].tmp.god = 1 msg2(id,'God mode on') else PLAYERS[id].tmp.god = 0 msg2(id,'God mode off') end return 1 		end 	end end
PLAYERS[id].tmp = {hp = 100, atk = 1, def = 1, spd = 0, god = 0, usgn = player(id, "usgn"), equip = {}, exhaust = {}}
addhook("hit","EXPhit") function EXPhit(id,source,weapon,hpdmg,apdmg) if PLAYERS[id].tmp.god == 1 then return 1 end 	local HP, dmg, wpnName, name = player(id, "health") 	if hpdmg <= 0 or source == 0 then 		PLAYERS[id].HP = HP-hpdmg 		return 	end
function Monster:hit(id, dmg) if PLAYERS[id].tmp.god == 1 then return end 	if not PLAYERS[id].Tutorial.hitm then 		message(id, "A monster is attacking you! You can fight back by swinging your weapon at it.", "255128000") 		PLAYERS[id].Tutorial.hitm = true 	end
--minutes delay until dropped items are automatically remove from the map (except items in houses) CLEANITEMSDELAY= 5,
function cleanitems() for k,v in pairs (GROUNDITEMS) do local x,y,height for a,b in pairs (v) do for c,d in pairs (b) do d[4] = d[4] -1 y=k x=a height=c if d[4] <= 0 and not TILEZONE[y][x].HOUSE then local item = d if item[1] == 1337 then if item[2] then freeimage(item[2]) end GROUNDITEMS[y][x][height] = nil else 							local tile = GROUNDITEMS[y][x] if tile.HEAL and ITEMS[item[1]].heal then tile.HEAL = tile.HEAL - ITEMS[item[1]].heal if tile.HEAL == 0 then tile.HEAL = nil end end if item[2] then freeimage(item[2]) end GROUNDITEMS[y][x][height] = nil end end end end end end
local heightoffset = (height < MAXHEIGHT and height or MAXHEIGHT)*3 item[4] = CONFIG.CLEANITEMSDELAY --this code
addhook("minute","EXPminute") function EXPminute() cleanitems() MINUTES = MINUTES+1 if game'sv_password' == '' and MINUTES%5 == 0 then saveserver() end end
addhook("minute","EXPminute2") function EXPminute2() cleanitems() MINUTES = MINUTES+1 if game'sv_password' == '' and MINUTES%5 == 0 then saveserver() end end