forked from ChimneySwift/fancy_vend
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdisable_global.lua
More file actions
29 lines (24 loc) · 927 Bytes
/
disable_global.lua
File metadata and controls
29 lines (24 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- Craftitem to display when vendor is inactive (Use just image for this???)
core.register_craftitem("fancy_vend:inactive", {
description = "Fancy Vendor Inactive Item (you hacker you!)",
inventory_image = "inactive.png",
groups = {not_in_creative_inventory = 1},
})
local modstorage = core.get_mod_storage()
if modstorage:get_string("all_inactive_force") == "" then
modstorage:set_string("all_inactive_force", "false")
end
fancy_vend.all_inactive_force = fancy_vend.stb(modstorage:get_string("all_inactive_force"))
core.register_chatcommand("disable_all_vendors", {
description = "Toggle vendor inactivity.",
privs = {disable_vendor = true},
func = function()
if fancy_vend.all_inactive_force then
fancy_vend.all_inactive_force = false
modstorage:set_string("all_inactive_force", "false")
else
fancy_vend.all_inactive_force = true
modstorage:set_string("all_inactive_force", "true")
end
end,
})