president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
Hi everyone I'm getting a weird problem in a new code.
The main idea of the script is, at Sunday/Friday at 8 p.m will set storage 291 for 2 minutes, and after this will remove
Thanks.
The main idea of the script is, at Sunday/Friday at 8 p.m will set storage 291 for 2 minutes, and after this will remove
Code:
Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
data/lib/core/game.lua:105: table index is nil
stack traceback:
[C]: in function '__newindex'
data/lib/core/game.lua:105: in function 'setStorageValue'
data/globalevents/scripts/hour.lua:7: in function <data/glob
alevents/scripts/hour.lua:6>
Code:
local config = {
storage = 291,
time = 2
}
function happyshit()
Game.setStorageValue(storage, 1)
addEvent(removex, config.time * 1000)
end
function removex()
Game.setStorageValue(storage, 0)
end
function onTime(interval)
if os.date('%A') == "Sunday" or os.date('%A') == "Friday" then
if Game.getStorageValue(config.storage) < 1 then
addEvent(happyshit, config.time * 1000)
end
end
return true
end
Thanks.