• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

script needed

EvilSkillz

Back
Joined
Jul 12, 2012
Messages
1,811
Solutions
2
Reaction score
390
Location
Egypt - Cairo
Listen my order is too low

i need script that you kill monster
this monster without dead corpse

just if you killed this monster
you will receive item in your bag (depend on luck chance to find this item)

and if you got this item
if you killed this monster again
it's will say
sorry , you are already obtained this item

any idea?
 
Just set corpse to 0 in monster file, make a creaturescript file using onKill funtion use math.rand funtion to set chance and check if player have item already, i dont havr pc atm so i cant write it by using phone.
 
LUA:
 local monster = "xxxx"   --Edit to your monster
local itemid = xxxx -- Set to the itemid of item you want to give
local storage = xxxx -- set to storage recieved or needed

function onKill(cid, target)
    if isPlayer(target) or getPlayerStorageValue(cid, storage) == 1 then
        return true
    end
    if isPlayer(cid) and getCreatureName(target) == monster then
    if getPlayerStorageValue(cid, 12345) <= storage then
    doPlayerAddItem(cid, itemid)
    doPlayerSetStorageValue(cid, storage, 1)
         end
    end
    return true
end

Try that, should work.
 
LUA:
-- Here is your configuration --
local conf = {monster = "MonsterName", storage = 49001, reward = {2160, 1}}

function onKill(cid, target)
	if isPlayer(cid) and not isPlayer(target) then
		if getCreatureName(target) == conf.monster then
    	    		local luck = math.random(0,10)
			if luck >= 5 and luck <= 7 then
				if getPlayerStorageValue(cid, conf.storage) == -1 then
					doPlayerAddItem(cid, conf.reward[1], conf.reward[2])
    					setPlayerStorageValue(cid, conf.storage, 1)
				else
					doPlayerSendTextMessage(cid, 25, "Sorry, you are already obtained this item")    		
				end
			end
            	end
    	end
	return true
end
 
Back
Top