. . . Posted May 25, 2020 Share Posted May 25, 2020 (edited) hi, i'm trying to make orange staff not able to see the reticule for teleporting when you're insane. right now the character when go to 0 sanity get "nosanity" tag and this is code i have Spoiler local function reticuleshouldhidefn(inst) return inst.replica.inventoryitem ~= nil and inst.replica.inventoryitem:IsHeldBy(ThePlayer) and ThePlayer.components.playercontroller ~= nil and ThePlayer:HasTag("nosanity") end AddPrefabPostInit("orangestaff", function(inst) inst.components.reticule.shouldhidefn = reticuleshouldhidefn end) i see this "inst.components.reticule.shouldhidefn" is used in the oceanfishingrod and apparently it works? so i have no idea why this doesn't seem to work for anything else i add it to which has a reticule.. does anyone know if i'm doing something wrong or is this actually a bug that should be reported? i tested so many thing from reticule and i am so lost now. so my short question is does anybody know how to hide reticule/remove it then add it back? Edited May 26, 2020 by --- -.- Link to comment https://forums.kleientertainment.com/forums/topic/118512-how-to-hide-reticule-and-unhide-it/ Share on other sites More sharing options...
Cunning fox Posted May 26, 2020 Share Posted May 26, 2020 7 hours ago, --- -.- said: hi, i'm trying to make orange staff not able to see the reticule for teleporting when you're insane. right now the character when go to 0 sanity get "nosanity" tag and this is code i have Hide contents local function reticuleshouldhidefn(inst) return inst.replica.inventoryitem ~= nil and inst.replica.inventoryitem:IsHeldBy(ThePlayer) and ThePlayer.components.playercontroller ~= nil and ThePlayer:HasTag("nosanity") end AddPrefabPostInit("orangestaff", function(inst) inst.components.reticule.shouldhidefn = reticuleshouldhidefn end) i see this "inst.components.reticule.shouldhidefn" is used in the oceanfishingrod and apparently it works? so i have no idea why this doesn't seem to work for anything else i add it to which has a reticule.. does anyone know if i'm doing something wrong or is this actually a bug that should be reported? i tested so many thing from reticule and i am so lost now. so my short question is does anybody know how to hide reticule/remove it then add it back? This should work AddPrefabPostInit("orangestaff", function(inst) local _targetfn = inst.components.reticule.targetfn inst.components.reticule.targetfn = function(...) local data = _targetfn(...) local player = ThePlayer if data and player and player.replica.sanity and player.replica.sanity:GetPercent() == 0 then return nil end return data end end) 1 Link to comment https://forums.kleientertainment.com/forums/topic/118512-how-to-hide-reticule-and-unhide-it/#findComment-1336385 Share on other sites More sharing options...
. . . Posted June 10, 2020 Author Share Posted June 10, 2020 @Cunning fox hello, I'm sorry but I just tested the code now lol but it seemed it didnt work. i tested it on a cave server btw maybe this is not possible then sadly Link to comment https://forums.kleientertainment.com/forums/topic/118512-how-to-hide-reticule-and-unhide-it/#findComment-1341059 Share on other sites More sharing options...
. . . Posted June 19, 2020 Author Share Posted June 19, 2020 bump Link to comment https://forums.kleientertainment.com/forums/topic/118512-how-to-hide-reticule-and-unhide-it/#findComment-1345632 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