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

Solved math.rand not working with onKill

ziggy46802

Active Member
Joined
Aug 19, 2012
Messages
418
Reaction score
27
LUA:
local chance = math.rand(2,5)

	if getCreatureName(target) == "Chicken"  and getPlayerStorageValue(cid, 15001) ~= 2 then
		setPlayerStorageValue(cid, 15001, chance)
 		doCreatureSay(cid, "You have added the creature 'Chicken' to your bestiary.", TALKTYPE_ORANGE_1)
			return true
		end

Here is a tidbit of my script, I don't see why making the storage value set to a random number makes the creature freeze when it dies, but when setting it to a real number it's just fine.

Any help?
 
Last edited:
if getCreatureName(target) == "Chicken" and getPlayerStorageValue(cid, 15001) ~= 2 and math.random(10) == 10 then
 
Back
Top