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

Lua Mount Based Spells

Siegh

Thronar Developer
Joined
Mar 12, 2011
Messages
1,309
Solutions
1
Reaction score
694
Location
Brazil
Hello, I have this script wich is a spell that should only work when a specific mount is being used, in this case id 2.
But it isnt working, seems like Im not using the function getPlayerMount correctly... I searched for similar scripts on the forum but couldnt find exactly what I wanted so, can someone please tell me how to make this work?

Code:
function onCastSpell(cid, var)

if getPlayerMount(cid) == 2 then
doCombat(cid, combat, var)
else
doPlayerSendTextMessage(cid, 22, "You must be mounted!")
return false
end

return true	
end

Thanks in advance.
 
try using:

LUA:
function onCastSpell(cid, var)
    if getCreatureOutfit(cid).lookMount == 2 then
        doCombat(cid, combat, var)
    else
        doPlayerSendTextMessage(cid, 22, "You must be mounted!")
        return false
    end
    return true    
end
 
Now I always get the "You must be mounted" message even if I have the right mount, tested with others also. Doesnt the "lookMount" needs a local or something?

EDIT: Nevermind, I fixed it changing the mount id with its looktype id (369 for the racing bird).

Thank you very much Scarlet :D

EDIT 2: Now the spell works even if Im unmounted. I mean, it still requires that I own the mount and select it on the outfit window, but even if I dont properly mount it, the spell still works. Any clue on how fixing this?
 
Last edited:
Use this or i kill you -.-

LUA:
local scarlet_is_wonderful = true -- True/False If its false then the script dont work and you suck -.-

function onCastSpell(cid, var)
    if scarlet_is_wonderful == true then 
    if getCreatureOutfit(cid).lookType == 2 then
        doCombat(cid, combat, var)
    else
        doPlayerSendTextMessage(cid, 22, "You must be mounted!")
        return false
    end
    return true    
end
end
 
Use this or i kill you -.-

LUA:
local scarlet_is_wonderful = true -- True/False If its false then the script dont work and you suck -.-

function onCastSpell(cid, var)
    if scarlet_is_wonderful == true then 
    if getCreatureOutfit(cid).lookType == 2 then
        doCombat(cid, combat, var)
    else
        doPlayerSendTextMessage(cid, 22, "You must be mounted!")
        return false
    end
    return true    
end
end

Hehe I will ;O

But do you know if its possible to fix the EDIT 2 part? Seems like the client recognizes me as mounted just by selecting it on the outfit window even if I havent properly mounted after this.
 
Humm, is it possible to make a "creature illusion" change yourself to a mounted looktype for lets say 10 seconds?
 
Back
Top