Hae Posted March 25, 2023 Share Posted March 25, 2023 Hi! Can you help me with the code to change the Displayname of an item from the sand box? --WITH SANDBOX OPTIONS require('NPCs/MainCreationMethods'); local NAME1; local function setLocalSandboxVars() NAME1 = SandboxVars.PerpetualItems.Name1; if NAME1 == nil then NAME1 = "Epic Hatchet"; end end local function initItemNamePerpetual() setLocalSandboxVars(); end local item1 = getItemDisplayName(BCGTools.KukriMachete); item1:setItemDisplayName(BCGTools.KukriMachete); Events.OnGameStart.Add(initItemNamePerpetual); Link to comment Share on other sites More sharing options...
Hugo Qwerty Posted March 25, 2023 Share Posted March 25, 2023 You want something like: local scriptItem = ScriptManager.instance:getItem("BCGTools.KukriMachete") if scriptItem then scriptItem:setDisplayName( SandboxVars.PerpetualItems.Name1 or "Epic Hatchet" ) end Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now