http://unrealsoftware.de/forum_posts.php?post=361647#jn
I wanted to make a deathscreen script that will show a image when you are dead.
Heres the full code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
deathscreen = {"gfx/minecraft_health/Death Screen/Deathscreen.png"} addhook("die","deathscreen") function deathscreen(id) 	if player(id, 'team') ~= 0 and player(id, 'health') > 0 then 	if healthimage[id] then freeimage(healthimage[id]) end 	deathscreen[id] = image("gfx/minecraft_health/Death Screen/Deathscreen.png",320,200,2,id) 	end end addhook("spawn","respawn") function respawn(id) 	if deathscreen[id] then freeimage(deathscreen[id]) end end
Line 208 is:
1
if deathscreen[id] then freeimage(deathscreen[id])
And then in console, it shows this
1
LUA ERROR: maps/as_mars.lua:208: attempt to index global 'deathscreen' (a function value)
Can anyone help?