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

Solved Attempt to call global 'getCreatureStorage' (a nil value)

Hugofasima

Website: thenosegang.servegame.com
Joined
Jun 24, 2015
Messages
206
Reaction score
23
Hello every one, I need to fix this script for TFS 1.1

My TFS is 1.0

places =
{
[1] = {placeName = "Depot", placeStorage = 6661, placepos = {x = 79, y = 63, z = 6}},
[2] = {placeName = "Gaz'Haragoth Lair", placeStorage = 6662, placepos = {x = 2073, y = 228, z = 9}},
[3] = {placeName = "Azshara North Catacomb", placeStorage = 6663, placepos = {x = 259, y = 401, z = 7}}
}

function getCatacombByName(name)
for k, v in pairs(places) do
if v.placeName:lower() == name:lower() then
return k
end
end
return false
end

function sendCatacombWindow(cid)
CatacombWindow = ModalWindow(1900, "Catacombs Teleporter", "Select place:")

if CatacombWindow:getId() == 1900 then
CatacombWindow:addButton(1, "Teleport")
CatacombWindow:setDefaultEnterButton(1)
CatacombWindow:addButton(2, "Cancel")
CatacombWindow:setDefaultEscapeButton(2)

for i = 1, #places do
if getCreatureStorage(cid, places.placeStorage) == 1 then
CatacombWindow:addChoice(i, places.placeName)
end
end

end
CatacombWindow:sendToPlayer(cid)
return true
end


Error:

Code:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/catacombs/teleporter.lua: onStepIn
data/catacombs.lua:28: attempt to call global 'getCreatureStorage' (a nil value)

stack traceback:
[C]: in function 'getCreatureStorage'
data/catacombs.lua:28: in function <data/catacombs.lua:17>
Please guys, I really don't know how to do it.
 
Last edited:
I can't believe TFS 1.1 scripts don't work with TFS 1.0. o_O TFS 0.3 scripts not working on TFS 1.1 - now that makes sense.

What errors are you getting?

Are you sure? I can reconfig the script so...


This error

Lua Script Error: [MoveEvents Interface]
data/movements/scripts/catacombs/teleporter.lua: onStepIn
data/catacombs.lua:28: attempt to call global 'getCreatureStorage' (a nil value)

stack traceback:
[C]: in function 'getCreatureStorage'
data/catacombs.lua:28: in function <data/catacombs.lua:17>

This is the script

places =
{
[1] = {placeName = "Depot", placeStorage = 6661, placepos = {x = 79, y = 63, z = 6}},
[2] = {placeName = "Gaz'Haragoth Lair", placeStorage = 6662, placepos = {x = 2073, y = 228, z = 9}},
[3] = {placeName = "Azshara North Catacomb", placeStorage = 6663, placepos = {x = 259, y = 401, z = 7}}
}

function getCatacombByName(name)
for k, v in pairs(places) do
if v.placeName:lower() == name:lower() then
return k
end
end
return false
end

function sendCatacombWindow(cid)
CatacombWindow = ModalWindow(1900, "Catacombs Teleporter", "Select place:")

if CatacombWindow:getId() == 1900 then
CatacombWindow:addButton(1, "Teleport")
CatacombWindow:setDefaultEnterButton(1)
CatacombWindow:addButton(2, "Cancel")
CatacombWindow:setDefaultEscapeButton(2)

for i = 1, #places do
if getCreatureStorage(cid, places.placeStorage) == 1 then
CatacombWindow:addChoice(i, places.placeName)
end
end

end
CatacombWindow:sendToPlayer(cid)
return true
end
 
Replace that with:
Code:
Player(cid):getStorage(places.placeStorage) == 1

Line 27?


Didn't work...

Lua Script Error: [MoveEvents Interface]
data/movements/scripts/catacombs/teleporter.lua:eek:nStepIn
data/catacombs.lua:27: attempt to call method 'getStorage' (a nil value)
stack traceback:
[C]: in function 'getStorage'
data/catacombs.lua:27: in function <data/catacombs.lua:17>
 
Last edited:
No, you are using deprecated and obsolete code. It should be:
Code:
if Player(cid):getStorageValue(places.placeStorage) == 1 then

For that line, I guess 27.
 
Back
Top