-- Compiled with @isentinel/roblox-ts v4.0.11 local TS = _G[script] local store = TS.import(script, TS.getModule(script, "@lisachandra", "core").store).store local getItemFromGUID = TS.import(script, TS.getModule(script, "@lisachandra", "matter").utils.item.state).getItemFromGUID local _centurion = TS.import(script, TS.getModule(script, "@rbxts", "centurion").out) local CenturionType = _centurion.CenturionType local Command = _centurion.Command local Guard = _centurion.Guard local Register = _centurion.Register local adminOrDeveloper = TS.import(script, script.Parent.Parent, "guards").adminOrDeveloper local SetCommand do SetCommand = setmetatable({}, { __tostring = function() return "SetCommand" end, }) SetCommand.__index = SetCommand function SetCommand.new(...) local self = setmetatable({}, SetCommand) return self:constructor(...) or self end function SetCommand:constructor() end function SetCommand:set(_, guid, propertiesStr) local item = getItemFromGUID(store.world, guid) if not item then return nil end local _exp = string.split(propertiesStr, ",") -- ▼ ReadonlyArray.map ▼ local _newValue = table.create(#_exp) local _callback = function(str) return string.split((string.gsub(str, "%s", "")), ":") end for _k, _v in _exp do _newValue[_k] = _callback(_v, _k - 1, _exp) end -- ▲ ReadonlyArray.map ▲ local properties = _newValue for _1, _binding in properties do local key = _binding[1] local value = _binding[2] if not (type(key) == "string") or not (item.data[key] ~= nil) then continue end local _arg0 = item.data[key] if type(_arg0) == "string" then item.data[key] = value else local _arg0_1 = item.data[key] if type(_arg0_1) == "number" then item.data[key] = (tonumber(value)) or item.data[key] end end end end local _decorator = Command({ arguments = { { type = CenturionType.String, description = "The GUID of the item you want to modify.", name = "itemGuid", }, { type = CenturionType.String, description = "The properties and values for the item you want to modify.\nFormat: key:value", name = "properties", } }, description = "Set new values to an item's properties.", name = "set", }) local _descriptor = Guard(adminOrDeveloper)(SetCommand, "set", { value = SetCommand.set, }) if _descriptor then SetCommand.set = _descriptor.value end local _descriptor_1 = _decorator(SetCommand, "set", { value = SetCommand.set, }) if _descriptor_1 then SetCommand.set = _descriptor_1.value end SetCommand = Register()(SetCommand) or SetCommand end return { SetCommand = SetCommand, }