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

Speed

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
I do not know use the function:
doChangeSpeed

But I created a script where it's easy to someone help me ...
Speed1.LUA:
PHP:
local yourSpeed = getCreatureSpeed(cid)

function onSay(cid, words, param)
	if getPlayerGroupId(cid) > 2 then
	   doChangeSpeed(cid, yourSpeed + 200)
	   doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, Now his speed is '..getCreatureSpeed(cid)..'.)
	end
	else
	   doChangeSpeed(cid, yourSpeed - 200)
	   doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, Now his speed is '..getCreatureSpeed(cid)..'.)
end
end
Speed2.LUA
PHP:
local yourSpeed = getCreatureSpeed(cid)

function onSay(cid, words, param)
	if getPlayerGroupId(cid) > 2 then
	   doChangeSpeed(cid, yourSpeed + 400)
	   doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, Now his speed is '..getCreatureSpeed(cid)..'.)
	end
	else
	   doChangeSpeed(cid, yourSpeed - 400)
	   doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, Now his speed is '..getCreatureSpeed(cid)..'.)
end
end
Speed3.LUA
PHP:
local yourSpeed = getCreatureSpeed(cid)

function onSay(cid, words, param)
	if getPlayerGroupId(cid) > 2 then
	   doChangeSpeed(cid, yourSpeed + 600)
	   doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, Now his speed is '..getCreatureSpeed(cid)..'.)
	end
	else
	   doChangeSpeed(cid, yourSpeed - 600)
	   doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, Now his speed is '..getCreatureSpeed(cid)..'.)
end
end
---
Easy, use the command:
/speed1 "on
/speed1 "off

/speed2 "on
/speed2 "off

/speed3 "on
/speed3 "off
---
It is impossible to enable more than one at the same time!
 
Code:
local yourSpeed = getCreatureSpeed(cid)
cid returns nil in your scripts.

Use it after function onSay().
 
I once made this script for that purpose:
boost.lua
Code:
---:::::: Boost script by Jonern ::::::---
---:::::: http://otland.net      ::::::---
function onSay(cid, words, param)
    if getPlayerGroupId(cid) >= 6 then
        if param == "slow" then
            doChangeSpeed(cid, getCreatureBaseSpeed(cid) * 0.3 - getCreatureSpeed(cid))
        elseif param == "normal" then
            doChangeSpeed(cid, getCreatureBaseSpeed(cid) - getCreatureSpeed(cid))
        elseif param == "fast" then
            doChangeSpeed(cid, getCreatureBaseSpeed(cid) * 2.5 - getCreatureSpeed(cid))
        elseif param == "bullet" then
            doChangeSpeed(cid, getCreatureBaseSpeed(cid) * 10 - getCreatureSpeed(cid))
        elseif string.find(param,"[0-9]") == TRUE then
            if tonumber(param) >= 50 and tonumber(param) <= 9000 then
                doChangeSpeed(cid, tonumber(param) - getCreatureSpeed(cid))
            else
                doPlayerSendCancel(cid, "Only speeds from 50 to 9000 is allowed.")
            end
        elseif string.sub(param,1,5) == "force" then
            if tonumber(string.sub(param,7,string.len(param))) > 0 and tonumber(string.sub(param,7,string.len(param))) <= 20000 then
                doChangeSpeed(cid, tonumber(string.sub(param,7,string.len(param))) - getCreatureSpeed(cid))
            else
                doPlayerSendCancel(cid, "Only speeds from 1 to 20000 is allowed.")
            end
        else
            doPlayerSendCancel(cid, "No or wrong speed given.")
        end
    end
end
Notice that I just for fun made that "force" thing, to be able to set speeds above 9000, but there's really no difference :P

Anyway, in talkactions.xml:
Code:
<talkaction filter="word" log="yes" access="5" words="!boost" script="boost.lua" />
Usage:
!boost slow
!boost normal (sets your speed back to normal)
!boost fast
!boost bullet
!boost 50-9000
!boost force 1-20000 (1 makes you use 100 seconds to walk one tile!)
 
Back
Top