L
LordVissie
Guest
Hey, I've 2 problems
1. I tried to make a ring script that gives you 10000 hp and 10000 mana. I want to make the ring as reward when you have been rebirth on my server. So If you have been reborned you'll get this ring in your backpack. But I got 2 errors:
These are my scripts:
The ring as reward:
The error says something about there is supposed to be a end at line 12, and I'm like
, There are 2 ends there.
2nd problem is that I also got a error with the reborn script I have.
The reborn system doesn't has the ring reward line yet.
I also don't understand this one error, what is <eof>?
Here is the reborn script:
If someone knows a solution please tell me I think they are pretty easy problems but I'm too noob to solve them.
Using version 0.3.6.
Kind regards,
LordVissie
1. I tried to make a ring script that gives you 10000 hp and 10000 mana. I want to make the ring as reward when you have been rebirth on my server. So If you have been reborned you'll get this ring in your backpack. But I got 2 errors:
Code:
[06/09/2015 09:40:29] [Error - LuaScriptInterface::loadFile] data/actions/scripts/Reborn ring.lua:12: 'end' expected (to close 'function' at line 1) near '<eof>'
[06/09/2015 09:40:29] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/Reborn ring.lua)
[06/09/2015 09:40:29] data/actions/scripts/Reborn ring.lua:12: 'end' expected (to close 'function' at line 1) near '<eof>'
These are my scripts:
The ring as reward:
Code:
function onEquip(cid, item, slot)
local gain = 10000
if item.itemid == 2357 then
if getPlayerLevel(cid) >= 150 then -- Level 150 or higher
doPlayerSendTextMessage(cid,19,"You now gained 10000 hp and mp!") -- Message onEquip you can also delete this line if you want to.
doCreatureAddMana(cid,gain)
doCreatureAddHealth(cid,gain)
else
doPlayerSendCancel(cid,"You need to be level 150 or higher to use this ring.") -- Cancel message when he is under level 150.
end
return true
end
The error says something about there is supposed to be a end at line 12, and I'm like
2nd problem is that I also got a error with the reborn script I have.
The reborn system doesn't has the ring reward line yet.
Code:
[06/09/2015 09:40:29] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/rebornsystem.lua:35: '<eof>' expected near 'else'
[06/09/2015 09:40:29] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/rebornsystem.lua)
[06/09/2015 09:40:29] data/talkactions/scripts/rebornsystem.lua:35: '<eof>' expected near 'else'
I also don't understand this one error, what is <eof>?
Here is the reborn script:
Code:
config = {
storage = 1234,
minLv = 6500, -- minimum lvl to use reborn,
newLv = 20, -- new level,
resetmphp = false, --[[ reset hp/mp true or false ]]--,
effect = 37, -- Effect to done reborn,
maxreb = 5 -- maximum reborn
}
function onSay(cid, words, param, channel)
if(getPlayerStorageValue(cid, config.storage) < 0) then
doPlayerSetStorageValue(cid, config.storage, 0)
end
if(getPlayerStorageValue(cid, config.storage) == 5) then
doPlayerSendCancel(cid, "You have max reborn: "..config.maxreb.."")
return true
end
if(config.resetmphp) == false then
setCreatureMaxHealth(cid, getCreatureHealth(cid))
doCreatureAddHealth(cid, 1)
setCreatureMaxMana(cid, getCreatureMana(cid))
doCreatureAddMana(cid, 1)
elseif(config.resetmphp) == true then
doCreatureAddMana(cid, 40-getCreatureMana(cid))
setCreatureMaxMana(cid, 40)
doCreatureAddHealth(cid, 185-getCreatureHealth(cid))
setCreatureMaxHealth(cid, 185)
end
If(getPlayerLevel(cid) >= config.minLv)
doPlayerAddLevel(cid, -getPlayerLevel(cid)+config.newLv)
doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1)
doPlayerSendTextMessage(cid, 21, "You advanced to reborn: "..getPlayerStorageValue(cid, config.storage).."")
doSendMagicEffect(cid, getCreaturePosition(cid),config.effect)
end
else <eof>
doPlayerSendCancel(cid, "You not have level:".. config.minLv.."")
doSendMagicEffect(cid, getCreaturePosition(cid), CONST_ME_POFF)
return true
end
end
If someone knows a solution please tell me I think they are pretty easy problems but I'm too noob to solve them.
Using version 0.3.6.
Kind regards,
LordVissie