Zonet
Web Developer
Hello. I made this script cuz I was bored.
Information:
When you "look" on a player, You'll see like "Zonet got storage 1". Which means he haven't reached lvl 300 yet.
When you reach lvl 300, you'll get storage 2 and start from lvl 8 from beginning. And it works like that, every time you reach lvl 300 your storage will be up (+1).
Also the good thing is that you can make in your highscore.php (website) so it counts by this storage (easily).
Go to data/creaturescript/scripts - create file, name it playerLook
Paste this in playerLook.lua
Go to data/creaturescript/scripts - create file, name it playerAdvance
Paste this in playerAdvance.lua
Go to Data/creaturescript/creaturescript.xml
Add
Go to Data/creaturescript/script/login.lua
Under function onlogin(cid)
Add
Under registerCreatureEvent(cid, "PlayerKill")
Add
Sorry! Script haven't been tested by anyone yet! Tell me if there is any errors!
:thumbup:
Information:
When you "look" on a player, You'll see like "Zonet got storage 1". Which means he haven't reached lvl 300 yet.
When you reach lvl 300, you'll get storage 2 and start from lvl 8 from beginning. And it works like that, every time you reach lvl 300 your storage will be up (+1).
Also the good thing is that you can make in your highscore.php (website) so it counts by this storage (easily).
Go to data/creaturescript/scripts - create file, name it playerLook
Paste this in playerLook.lua
Lua:
--[[
Script coded by zonet.
using storage = 9000
]]--
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid) == false) then
return true
end
local storage = 9000
if(getPlayerStorageValue(thing.uid, storage) < 1) then
doPlayerSendTextMessage(cid, 20, ""..getCreatureName(thing.uid).." doesn\'t have any storage.")
return true
end
if(getPlayerStorageValue(thing.uid, storage) >= 1) then
doPlayerSendTextMessage(cid, 20, ""..getCreatureName(thing.uid).." got a storage "..getPlayerStorageValue(thing.uid, storage)..".")
return true
end
return true
end
Go to data/creaturescript/scripts - create file, name it playerAdvance
Paste this in playerAdvance.lua
Lua:
--[[
Script coded by zonet.
using storage = 9000
]]--
function onAdvance(cid, skill, oldlevel, newlevel)
local config = {
level = 300,
storage = 9000,
startLevel = 8
}
local tPos = {x =100, y =100, z =7}
if(skill == SKILL__LEVEL and newlevel >= config.level) then
setPlayerStorageValue(cid, getPlayerStorageValue(cid, config.storage) + 1)
doTeleportThing(cid, tPos)
setPlayerMaxMana(cid, 35)
setCreatureMaxHealth(cid, 185)
doRemoveCreature(cid)
db.executeQuery("UPDATE ´players´ SET ´level´ = '"..config.startLevel.."', ´experience´ = '"..getExperienceForLevel(config.startLevel).."' WHERE ´name´ = '"..getPlayerName(cid).."';")
end
return true
end
Go to Data/creaturescript/creaturescript.xml
Add
Code:
<event type="look" name="Look" event="script" value="playerLook.lua"/>
<event type="advance" name="Advance" event="script" value="playerAdvance.lua"/>
Go to Data/creaturescript/script/login.lua
Under function onlogin(cid)
Add
Lua:
setPlayerStorageValue(cid, 9000, 1)
Add
Lua:
registerCreatureEvent(cid, "Advance")
registerCreatureEvent(cid, "Look")
Sorry! Script haven't been tested by anyone yet! Tell me if there is any errors!
:thumbup:
Last edited: