Residays Posted April 19, 2017 Share Posted April 19, 2017 Making my first mod, nothing happens at all when I try to light and/or hammer a structure. What am I doing wrong? How can I solve it? Thanks in advance. Spoiler -- STRUCTURES local function OnBuild_becomevalid(prod, inst) if prod.components.inventoryitem == nil or (prod.components.inventoryitem and prod.components.stackable == nil) then prod:AddTag("thisisvalid") GLOBAL.TheNet:Announce("A".. prod:GetDisplayName().. "has been built by " ..inst:GetDisplayName().."!") end end local old_ACTION_HAMMER = GLOBAL.ACTIONS.HAMMER.fn GLOBAL.ACTIONS.HAMMER.fn = function(act) if act.target:HasTag("thisisvalid") then GLOBAL.TheNet:Announce("A "..act.target:GetDisplayName().." has been hammered by "..act.doer:GetDisplayName().."!") end return old_ACTION_HAMMER(act) end local old_LIGHT_function = GLOBAL.ACTIONS.LIGHT.fn GLOBAL.ACTIONS.LIGHT.fn = function(act) if act.target:HasTag("thisisvalid") then GLOBAL.TheNet:Announce("A "..act.target:GetDisplayName().." has been lighted by "..act.doer:GetDisplayName().."!!") end return old_LIGHT_function(act) end Link to comment Share on other sites More sharing options...
Serpens Posted April 20, 2017 Share Posted April 20, 2017 maybe this helps?http://steamcommunity.com/sharedfiles/filedetails/?id=624986374 Link to comment Share on other sites More sharing options...
Residays Posted April 20, 2017 Author Share Posted April 20, 2017 3 hours ago, Serpens said: maybe this helps?http://steamcommunity.com/sharedfiles/filedetails/?id=624986374 If you didn't post, I wouldn't have realized I was lacking something very important, thanks a lot! 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