Lava Titan
Developer
Hello guys, i'm trying to learn lua and cyko was helping me but since i dont want to bother him more, im looking for someone that has free time to help me fixing this script that i started doing but doesnt work and i cant find the error.
I'm trying to make a item that when is used gives a mount to a player.
Like: Carrot on a stick, when i click use "Carrot on a stick" it would add the mount to my character without any problems.)
But if i have mount already it should sendCancel saying "You already have this mount."
I cant find any error in the script but when i try to put it working on a server it doesnt work.
I would be greatfull if you help me fixing it or explain me how to fix it and what was the problem so in the future i could fix it my self.
I'm trying to make a item that when is used gives a mount to a player.
Like: Carrot on a stick, when i click use "Carrot on a stick" it would add the mount to my character without any problems.)
But if i have mount already it should sendCancel saying "You already have this mount."
I cant find any error in the script but when i try to put it working on a server it doesnt work.
PHP:
local mountid = 2
local name = 'Terror Bird'
function onUse(cid, item)
if (getPlayerMount(cid, mountid) == true) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doCreatureSay(cid, "You already have this mount.", TALKTYPE_ORANGE_1)
else
doPlayerAddMount (cid, mountid)
doCreatureSay(cid, "You received a '...name...' mount.", TALKTYPE_ORANGE_1)
return true
end
I would be greatfull if you help me fixing it or explain me how to fix it and what was the problem so in the future i could fix it my self.
