kaiquefb
New Member
- Joined
- Feb 18, 2010
- Messages
- 62
- Reaction score
- 0
Hello,
I use TFS 1.0 in version 10.76
I have an error in my console when a player dies.
this is the lua script.
I use TFS 1.0 in version 10.76
I have an error in my console when a player dies.
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/elemental spheres quest/the_elemental_spheres.lua:onDeath
...cripts/elemental spheres quest/the_elemental_spheres.lua:14: attempt to index local 't' (a nil value)
stack traceback:
[C]: in function '__index'
...cripts/elemental spheres quest/the_elemental_spheres.lua:14: in function <...cripts/elemental spheres quest/the_elemental_spheres.lua:9>
this is the lua script.
Code:
local boss = {
["fire overlord"] = {g_storage = 40064, p_storage = 60027},
["energy overlord"] = {g_storage = 40065, p_storage = 60028},
["ice overlord"] = {g_storage = 40066, p_storage = 60029},
["earth overlord"] = {g_storage = 40067, p_storage = 60030},
}
function onDeath(cid, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
local pid = Player(mostdamagekiller)
local t = boss[Creature(cid):getName():lower()]
Player(pid):setStorageValue(t.p_storage, 1)
setGlobalStorageValue(t.g_storage, -1)
return true
end
function onKill(cid, target)
if Creature(target):getName():lower() == "lord of the elements" then
Player(cid):setStorageValue(60031, 1)
end
return true
end
function onLogin(cid)
Player(cid):registerEvent("ElementalSpheresKill")
return true
end