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

Action Script

Aako

New Member
Joined
May 5, 2011
Messages
32
Reaction score
1
Greetings! Everyone :) I have randomly console problems about this script, can somebody helpme?
Lua:
function onUse(cid, item)

local outfit = {lookType = 342}
local exhaust = 140
local time = 60
local speed = 150 
local mana = 0
local premium = "yes" 
local storage = 9393

if premium == "yes" and not isPremium(cid) then
return doPlayerSendTextMessage(cid, 23, "Sorry, only premium players.")
end

if(getCreatureMana(cid) < mana) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
end

if (getPlayerStorageValue(cid, storage) <= os.time()) then
doCreatureSay(cid, "Yeeeah!!!\nDime Vaquero!.", 19) 
doSetCreatureOutfit(cid, outfit, time*1000)
doChangeSpeed(cid, speed)
doSendMagicEffect(getCreaturePosition(cid), 34)
setPlayerStorageValue(cid, storage, os.time()+exhaust)
doPlayerAddMana(cid, -mana)
addEvent(doChangeSpeed, time*1000+40, cid, -speed)
addEvent(doPlayerSendTextMessage, time*1000+180, cid, 23, "Tu Montura ha terminado!")
addEvent(doSendMagicEffect, time*1000+50, getCreaturePosition(cid), 2)
doRemoveItem(item.uid, 0)
else
doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.")
end
return TRUE
end
 
Im so sorry for my delay, my error is this:

XML:
[Error - Action Interface]
In a timer event called from:
data/actions/scripts/mount.lua:onUse
Description:
<LuaDoPlayerSendTextMessage> Creature not found

[Error - Action Interface]
In a timer event called from:
data/actions/scripts/mount.lua:onUse
Description:
<LuaDoPlayerSendTextMessage> Player not found
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local outfit = {lookType = 342}
local exhaust = 140
local time = 60
local speed = 150 
local mana = 0
local premium = "yes" 
local storage = 9393
 
if premium == "yes" and not isPremium(cid) then
	return doPlayerSendTextMessage(cid, 23, "Sorry, only premium players.")
end
 
if(getCreatureMana(cid) < mana) then
	return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
end
 
if (getPlayerStorageValue(cid, storage) <= os.time()) then
	doCreatureSay(cid, "Yeeeah!!!\nDime Vaquero!.", 19) 
	doSetCreatureOutfit(cid, outfit, time*1000)
	doChangeSpeed(cid, speed)
	doSendMagicEffect(getCreaturePosition(cid), 34)
	setPlayerStorageValue(cid, storage, os.time()+exhaust)
	doPlayerAddMana(cid, -mana)
	addEvent(doChangeSpeed, time*1000+40, cid, -speed)
	addEvent(doPlayerSendTextMessage, time*1000+180, cid, 23, "Tu Montura ha terminado!")
	addEvent(doSendMagicEffect, time*1000+50, getCreaturePosition(cid), 2)
	doRemoveItem(item.uid, 0)
		else
	doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.")
end
return TRUE
end
 
Back
Top Bottom