• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Random generate number

Status
Not open for further replies.

albag

Respected Member
hello i am stuch abit on this error

i did remove all custom npc loot and add some custom one

but i wanna do so the change is random number

atm they are 50 or 80

and did try to make this
but it dont work

DECLARE @UPPER INT ,
@LOWER INT;

SET @LOWER = 1
SET @UPPER = 80

UPDATE `creature_loot_template` SET 'ChanceOrQuestChance' = ROUND (((@UPPER - @LOWER -1)*RAND() + @LOWER) ,0) WHERE (`ChanceOrQuestChance`>='1')
 

albag

Respected Member
Thank you Rochet2 for helping me out

SET @LOWER = 1;
SET @UPPER = 80;

UPDATE creature_loot_template SET ChanceOrQuestChance = ROUND (((@UPPER - @LOWER -1)*RAND() + @LOWER) ,0) WHERE (ChanceOrQuestChance>=1);
 
Status
Not open for further replies.
Top