Lua nil value error in boss raid script

alcapone

Member
Joined
Jan 13, 2021
Messages
44
Reaction score
5
Lua:
function onRaid()   
        Game.setStorageValue(GlobalStorage.boss, 4)
      
end

is registered in the storage lib

2021-03-20 18:39:08 - Lua Script Error: [Raid Interface]
2021-03-20 18:39:08 - data/raids/scripts/boss.lua:eek:nRaid
2021-03-20 18:39:08 - data/raids/scripts/boss.lua:2: attempt to call global 'setGlobalStorageValue' (a nil value)
2021-03-20 18:39:08 - stack traceback:
2021-03-20 18:39:08 - [C]: in function 'setGlobalStorageValue'
2021-03-20 18:39:08 - data/raids/scripts/boss.lua:2: in function <data/raids/scripts/boss.lua:1>
 
OP
A

alcapone

Member
Joined
Jan 13, 2021
Messages
44
Reaction score
5
Im on mobile pls only the raid part
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<raids>
    <!-- Yalahar -->
    <raid name="boss" file="yalahar/boss.xml" interval2="500" margin="60" />
   
</raids>
raid xml



Lua:
<?xml version="1.0" encoding="utf-8"?>
<raid>
    <announce delay = "1000" type = "Event" message = "Something is rumbling deep underground all over the world" />
         <script delay="1000" script="boss.lua" />
</raid >

tfs 1x+
 

Snavy

Bakasta
Senator
Joined
Apr 1, 2012
Messages
1,244
Solutions
71
Reaction score
545
Location
Hell
Stop prank?
boss.lua is in the first post.

Lua:
function onRaid() 
    Game.setStorageValue(GlobalStorage.boss, 4)
end

I am confused.
Error says boss.lua:2: attempt to call global 'setGlobalStorageValue' (a nil value)

you are showing Game.setStorageValue(GlobalStorage.boss, 4)

Where is setGlobalStorageValue used?

Do you have this?
 

forgee

Veteran OT User
Joined
May 9, 2011
Messages
321
Solutions
16
Reaction score
270
Location
Sweden
GitHub
forgee
Stop prank?
boss.lua is in the first post.

Lua:
function onRaid() 
    Game.setStorageValue(GlobalStorage.boss, 4)
end
The error doesn't match the "script".
The error says it attempts to call 'setGlobalStorageValue', not 'Game.setStorageValue'.

setGlobalStorageValue is a compat function that calls Game.SetStorageValue:
 
OP
A

alcapone

Member
Joined
Jan 13, 2021
Messages
44
Reaction score
5
I am confused.
Error says boss.lua:2: attempt to call global 'setGlobalStorageValue' (a nil value)

you are showing Game.setStorageValue(GlobalStorage.boss, 4)

Where is setGlobalStorageValue used?

Do you have this?
is that I was testing others that I was finding on the forum

lib
compat
Lua:
function getGlobalStorageValue(key)
    return Game.getStorageValue(key) or -1
end

function setGlobalStorageValue(key, value)
    Game.setStorageValue(key, value)
    return true
end
 
Top