• 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 onUse help, very simple script.

highclick

New Member
Joined
Mar 21, 2011
Messages
80
Reaction score
4
I got some shishas in game, i want the character too say "Puff Puff" when he clicks on them, I've assigned ACTIONID 2002 too the Shishas.

This is my .xml:

Code:
    <action actionid="2002" event="script" value="other/shisha.lua"/> <!-- Shisha -->

This is my .lua:

Code:
function onUse(cid, item,)
        doCreatureSay(cid, "Puff Puff", TALKTYPE_ORANGE)
    return true
end


IMPORTANT READ: I tried too remove the last "," in the "function onUse(cid, item,)". It caused my client and my friends client too crash when trying too use the shisha.

Thank you in advance
 
Always tells us the server version, why the actionid why not just use the itemid?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    doCreatureSay(cid, "Puff Puff", TALKTYPE_ORANGE)
    return true
end
 
Your client is most likely crashing because TALKTYPE_ORANGE does not exist.
Try using TALKTYPE_ORANGE_1 instead with Breed's code.
 
Always tells us the server version, why the actionid why not just use the itemid?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    doCreatureSay(cid, "Puff Puff", TALKTYPE_ORANGE)
    return true
end

Sorry! I keep forgetting. The solution wa too use TALKTYPE_ORANGE_1 instead of TALKTYPE_ORANGE
 
To find constant names you can use you can look in data/lib 000-constant.lua and 100-compat.lua.
If you use a not existing constant name (or a wrong one) your client will crash.
 
Back
Top