• 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 doChangeSpeed function

Dexftw

Total Boss
Joined
Jan 30, 2011
Messages
317
Reaction score
8
doChangeSpeed(cid, delta) What is delta supposed to be? And also, would adding doChangeSpeed(cid, delta, time) work to set a time limit?

Thanks ^_^
 
No there is no 'time' parameter.
Delta is always a difference, so it will increase the speed by that.

Example:
Speed before: 240
doChangeSpeed(cid, 30)
Speed after: 270


Speed before: 240
doChangeSpeed(cid, -50)
Speed after: 190
 
No there is no 'time' parameter.
Delta is always a difference, so it will increase the speed by that.

Example:
Speed before: 240
doChangeSpeed(cid, 30)
Speed after: 270


Speed before: 240
doChangeSpeed(cid, -50)
Speed after: 190
So in other words, it's staying that way after they use the item. Yeh?
 
@Up(Up): Yes, but you can an addEvent, and use this function so it returns to their natural speed
Lua:
getCreatureBaseSpeed(cid)
 
Guess I can work with that, if there is no other function to do it, thanks for teaching me some more ^_^
 
doChangeSpeed (cid,150)
doTransformItem(item.uid, item.itemid + 1) How Can i get my item to decay into a dish in the script instead of +1? doPlayerRemoveItem(cid, itemid, count[, subtype]) <- that would work aswell, doplayeremoveitem(cid,9998,1[,subtype]) no idea what to put for subtype? also I'm afraid that would remove the item without doing the effect
 
the subtype parameter is optional as it's between [] so you can leave it if you want also if you want to decay it into a dish use:
Lua:
doTransformItem(item.uid, input item id of dish here (example: 2351))
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 9998 then
doChangeSpeed(cid,60)
doPlayerSendTextMessage(cid,21,"The heat of the peppers have increased your speed for a while")
doTransformItem(item.uid,2351) Would that worK?
 
Yes that would change your pepper to itemid 2351 (that must be some kind of armor or something)
Also you forgot:
Lua:
end
return true
end
at the end of script
Also if you post lua script you can use [.lua] script here [./lua] to post it in lua tags (don't enter the dots)
 
Yes that would change your pepper to itemid 2351 (that must be some kind of armor or something)
Also you forgot:
Lua:
end
return true
end
at the end of script
Also if you post lua script you can use [.lua] script here [./lua] to post it in lua tags (don't enter the dots)
Yeah thanks dude I remember the return true and what not^_^ everything is working perfectly as Id hoped just tested it, only thing Id like to add is how can I make it when I use the dish it does the orange letters above the player? or send a magic effect like when you use exura either one will do fine cause seeing it in the chatbox as blue is easily overlooked
 
Use:
doCreatureSay instead of doPlayerSendTextMessage
And about the effect, you can find effects in data/lib/000-constant.lua
And the function is:
Lua:
doSendMagicEffect(position, effect)
 
Back
Top Bottom