• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Attribute speed by percent and not value

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,484
Solutions
9
Reaction score
217
hello folks, I want know, if is possible to make the attribute speed in items or mounts be by percent
exemple:
Code:
boots of haste = 20%
this speed will be 20% percent of the speed that the player have in your level
 
yes its possible but u would have to make a movement script
for example
Code:
function onEquip(cid, item, slot)
    player = Player(cid)
    player:changeSpeed(player:getSpeed()*0.2)
    return true
end
(tfs 1.1x)

same thing works with mounts.

but u would need to make a onDeEquip script that removes the speed u got.

for it to work with attributes in items.xml u need source edit.
 
i suggest using conditon HASTE on equip and deequip.
Instead on player:getSpeed()
use player:getBaseSpeed()
 
yes its possible but u would have to make a movement script
for example
Code:
function onEquip(cid, item, slot)
    player = Player(cid)
    player:changeSpeed(player:getSpeed()*0.2)
    return true
end
(tfs 1.1x)

same thing works with mounts.

but u would need to make a onDeEquip script that removes the speed u got.

for it to work with attributes in items.xml u need source edit.
how I use this?
with this params
(player, item, slot)
Code:
function onEquip(player, item, slot)
    local speed = player:getSpeed()
    player:changeSpeed(speed * 0.2)
    return true
end
is it?
 
Back
Top