• 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!

a sexy request

WiLDTuRTLE

Member
Joined
Feb 26, 2011
Messages
478
Reaction score
5
onUse [hydra egg, forgot the id], it shows effet 35 on every use, % of breaking the egg and spawning a certain monster, & % of the egg to break and not spawn anything and send a message to the player. Item must be on the floor to be used.
 
sorry bad english kk

Code:
local config = {
   eff = 35,
   chance = 50, --50% chance spawn the monster
   monster = 'Hydra', --monster which will spawn
   msg = "Sorry...", --msg that will be sent to the player IF the egg 'fails'
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(fromPosition.x == CONTAINER_POSITION) then
      return doPlayerSendCancel(cid, "Please, first put your egg on the floor.")
   end
   
   doSendMagicEffect(getThingPos(cid), config.eff)
   if math.random(100) <= config.chance then
      doSummonCreature(config.monster, fromPosition)
   else
      doPlayerSendTextMessage(cid, 27, config.msg) 	 
   end
   doRemoveItem(item.uid, 1)   
return true                                            
end
 
sorry bad english kk

Code:
local config = {
   eff = 35,
   chance = 50, --50% chance spawn the monster
   monster = 'Hydra', --monster which will spawn
   msg = "Sorry...", --msg that will be sent to the player IF the egg 'fails'
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(fromPosition.x == CONTAINER_POSITION) then
      return doPlayerSendCancel(cid, "Please, first put your egg on the floor.")
   end
   
   doSendMagicEffect(getThingPos(cid), config.eff)
   if math.random(100) <= config.chance then
      doSummonCreature(config.monster, fromPosition)
   else
      doPlayerSendTextMessage(cid, 27, config.msg) 	 
   end
   doRemoveItem(item.uid, 1)   
return true                                            
end

Works as i wanted, but few things that doesnt work as i wanted, the effet should be on the egg and not on player, & like it doesnt totally work as i wanted.
The egg breaks or spawn, i want it to never breaks UNLESS it spawn or get the % of breaking.
let me know if you didnt understand, like the egg can "miss (add effet)" miss miss spawn.
On each use the egg get the effet (even if doesnt break or spawn)
 
Like this?

LUA:
local config = {
   eff = 35,
   chance = 50, --50% chance spawn the monster
   monster = 'Hydra', --monster which will spawn
   msg = "Sorry...", --msg that will be sent to the player IF the egg 'fails'
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(fromPosition.x == CONTAINER_POSITION) then
      return doPlayerSendCancel(cid, "Please, first put your egg on the floor.")
   end
   
   if math.random(100) <= config.chance then
     doSendMagicEffect(fromPosition, config.eff)
      doSummonCreature(config.monster, fromPosition)
	     doRemoveItem(item.uid, 1)   
   else
      doPlayerSendTextMessage(cid, 27, config.msg) 
doSendMagicEffect(fromPosition, CONST_ME_POFF)	 
   end
 
return true                                            
end
 
Like this?

LUA:
local config = {
   eff = 35,
   chance = 50, --50% chance spawn the monster
   monster = 'Hydra', --monster which will spawn
   msg = "Sorry...", --msg that will be sent to the player IF the egg 'fails'
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(fromPosition.x == CONTAINER_POSITION) then
      return doPlayerSendCancel(cid, "Please, first put your egg on the floor.")
   end
   
   if math.random(100) <= config.chance then
     doSendMagicEffect(fromPosition, config.eff)
      doSummonCreature(config.monster, fromPosition)
	     doRemoveItem(item.uid, 1)   
   else
      doPlayerSendTextMessage(cid, 27, config.msg) 
doSendMagicEffect(fromPosition, CONST_ME_POFF)	 
   end
 
return true                                            
end
yesssssss !!
But it always sends the message "sorry~"
Could you edit it that even if it doesnt spawn, say nothing but the effet, and if the egg break (that 5% chance to break without spawning) it says the sorry msg, add that <--- rest looks perfect <3


@J.Dre, Nop not what im loooking for :P tyvm thought.
 
Havent tested but you can try this:
LUA:
local config = {
   eff = 35,
   chance = 50, --50% chance spawn the monster
   breakchance = 5, -- 5% chance to break
   monster = 'Hydra', --monster which will spawn
   msg = "Sorry...", --msg that will be sent to the player IF the egg 'fails'
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(fromPosition.x == CONTAINER_POSITION) then
      return doPlayerSendCancel(cid, "Please, first put your egg on the floor.")
   end
 
   if math.random(100) <= config.breakchance then
        doPlayerSendTextMessage(cid, 27, config.msg) 
		doRemoveItem(item.uid, 1)   
	end
   if math.random(100) <= config.chance then
     doSendMagicEffect(fromPosition, config.eff)
      doSummonCreature(config.monster, fromPosition)
	     doRemoveItem(item.uid, 1)   
   else	 
	  doSendMagicEffect(fromPosition, CONST_ME_POFF)
   end
 
return true                                            
end
 
Havent tested but you can try this:
LUA:
local config = {
   eff = 35,
   chance = 50, --50% chance spawn the monster
   breakchance = 5, -- 5% chance to break
   monster = 'Hydra', --monster which will spawn
   msg = "Sorry...", --msg that will be sent to the player IF the egg 'fails'
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(fromPosition.x == CONTAINER_POSITION) then
      return doPlayerSendCancel(cid, "Please, first put your egg on the floor.")
   end
 
   if math.random(100) <= config.breakchance then
        doPlayerSendTextMessage(cid, 27, config.msg) 
		doRemoveItem(item.uid, 1)   
	end
   if math.random(100) <= config.chance then
     doSendMagicEffect(fromPosition, config.eff)
      doSummonCreature(config.monster, fromPosition)
	     doRemoveItem(item.uid, 1)   
   else	 
	  doSendMagicEffect(fromPosition, CONST_ME_POFF)
   end
 
return true                                            
end

You're a fucking. Boss.
thanks alotttttttttt, reped
 
Back
Top