---------Sorting Hat 2.0 System by XD , based on a Colex Script--------
function onUse(cid, item, frompos, item2, topos)
team = math.random(2,5)
gry = getPlayerStorageValue(cid,3020)
sly = getPlayerStorageValue(cid,3021)
rav = getPlayerStorageValue(cid,3022)
huf = getPlayerStorageValue(cid,3023)
if gry == -1 and sly == -1 and rav == -1 and huf == -1 and team == 2 then
doPlayerSendTextMessage(cid,22,"Sorting Hat says: i think you should be a Grifyndor student!")
doPlayerSay(cid,'Gryfindor!',1)
setPlayerStorageValue(cid,3020,1)
elseif gry == -1 and sly == -1 and rav == -1 and huf == -1 and team == 3 then
doPlayerSendTextMessage(cid,22,"Sorting Hat says: i think you should be a Slytherin student!")
doPlayerSay(cid,'Slytherin!',1)
setPlayerStorageValue(cid,3021,1)
elseif gry == -1 and sly == -1 and rav == -1 and huf == -1 and team == 4 then
doPlayerSendTextMessage(cid,22,"Sorting Hat says: i think you should be a Ravenclaw student!")
doPlayerSay(cid,'Ravenclaw!',1)
setPlayerStorageValue(cid,3022,1)
elseif gry == -1 and sly == -1 and rav == -1 and huf == -1 and team == 5 then
doPlayerSendTextMessage(cid,22,"Sorting Hat says: i think you should be a Hufflepuff student!")
doPlayerSay(cid,'Hufflepuff!',1)
setPlayerStorageValue(cid,3023,1)
elseif gry == 1 then
doPlayerSendTextMessage(cid,22,"Sorting Hat says: You already have a team , your team is Grifyndor!")
elseif sly == 1 then
doPlayerSendTextMessage(cid,22,"Sorting Hat says: You already have a team , your team is Slytherin!")
elseif rav == 1 then
doPlayerSendTextMessage(cid,22,"Sorting Hat says: You already have a team , your team is Ravenclaw!")
elseif huf == 1 then
doPlayerSendTextMessage(cid,22,"Sorting Hat says: You already have a team , your team is Hufflepuff!")
end
return 1
end