local config = {
stor = 123456,
msg = true,
txt = "You cannot walk.",
type = 21,
}
local function getSpeed(cid, level) return (220 + (2 * (level - 1))) end
local function canWalk(cid)
if isPlayer(cid) then
if getPlayerStorageValue(cid, config.stor) >= 1 then
doChangeSpeed(cid, getSpeed(cid, getPlayerLevel(cid)))
else
doChangeSpeed(cid, 0)
end
addEvent(canWalk, 250, cid)
end
return true
end
function onLogin(cid)
canWalk(cid)
if config.msg then
if getPlayerStorageValue(cid, config.stor) <= 0 then
doPlayerSendTextMessage(cid, config.type, config.txt)
end
end
return true
end