kaspertje100
Member
- Joined
- May 8, 2008
- Messages
- 236
- Reaction score
- 7
Hi Otlanders,
I'm having some trouble with my script to unmount.
error:
I need the player restore too their outfit which they had before they used the mount function, please help me doing this!
p.s im using this script too mount: (maybe I should some storage here so the server knows which outfit the player was wearing?)
well please help me!
Iam not a very experienced scripter;s most of the codes I used examples which where standing on Otland xD however im trying to become better and better please help me and teach me!
I'm having some trouble with my script to unmount.
error:
Code:
[12/05/2013 22:13:38] [Error - Action Interface]
[12/05/2013 22:13:38] data/actions/scripts/other/demount.lua:onUse
[12/05/2013 22:13:38] Description:
[12/05/2013 22:13:38] data/lib/011-string.lua:16: bad argument #1 to 'find' (string expected, got nil)
[12/05/2013 22:13:38] stack traceback:
[12/05/2013 22:13:38] [C]: in function 'find'
[12/05/2013 22:13:38] data/lib/011-string.lua:16: in function '(for generator)'
[12/05/2013 22:13:38] data/lib/011-string.lua:16: in function 'explode'
[12/05/2013 22:13:38] data/actions/scripts/other/demount.lua:17: in function <data/actions/scripts/other/demount.lua:5>
LUA:
local foncig = {
acceptedOutfits = {136, 128, 137, 129, 138, 130, 139, 131, 140, 132, 141, 133, 142, 134, 147, 143, 148, 144, 149, 145, 150, 146, 155, 151, 156, 152, 157, 153, 158, 154, 252, 251, 269, 268, 270, 273, 279, 278, 288, 289, 324, 325, 336, 335, 366, 367, 329, 328}
}
function onUse(cid, item)
local currentOutfit = getCreatureOutfit(cid)
if(isInArray(foncig.acceptedOutfits, currentOutfit.lookType)) then
doCreatureSetStorage(cid, foncig.outfitSlots[t[1]].storage, "_".. currentOutfit.lookType ..",_".. currentOutfit.lookHead ..",_".. currentOutfit.lookBody ..",_".. currentOutfit.lookLegs ..",_".. currentOutfit.lookFeet ..",_".. currentOutfit.lookAddons)
doCreatureSay(cid, "You dismounted your horse", 19)
doChangeSpeed(cid, -100)
doSendMagicEffect(getCreaturePosition(cid), 2)
doRemoveItem(item.uid, 1)
doPlayerAddItem(cid, 2354, 1)
else
doPlayerSendCancel(cid, "Sorry not possible.")
end
local t = string.explode(param, ",")
t[1] = tonumber(t[1])
local o = tostring(getCreatureStorage(cid, foncig.outfitSlots[t[1]].storage)):gsub('_', ''):explode(',')
if(o[6]) then
doCreatureChangeOutfit(cid, {lookType = o[1], lookHead = o[2], lookBody = o[3], lookLegs = o[4], lookFeet = o[5], lookAddons = o[6]})
end
end
I need the player restore too their outfit which they had before they used the mount function, please help me doing this!
p.s im using this script too mount: (maybe I should some storage here so the server knows which outfit the player was wearing?)
LUA:
function onUse(cid, item)
doCreatureSay(cid, "You mounted your horse!", 19)
doChangeSpeed(cid, 100)
doSendMagicEffect(getCreaturePosition(cid), 34)
doCreatureChangeOutfit(cid, {lookType = 342})
doRemoveItem(item.uid, 1)
doPlayerAddItem(cid, 2193, 1)
end
well please help me!
Iam not a very experienced scripter;s most of the codes I used examples which where standing on Otland xD however im trying to become better and better please help me and teach me!