Disable player inventory when walking on part

I made this cage as safezone,when a player walk on the floor, his healt regenerate completely,I also wanted to script that part to disable palyer 's inventory (because it is a safezone) when they walk on it.I already tried with a separated script in the part but it didnt worked,what can I do ?

3 Likes

Seems like something you can just search up. From a LocalScript, SetCoreGuiEnabled. Pass Enum.CoreGuiType.Backpack as the first argument and a boolean as the second, determining whether the Gui should be enabled or not. The client must call this in the end but you can have either the server or the client determine when this should happen, doesn’t matter.

If you’ve already tried, mind showing your attempt so you can be corrected based on what you’ve already tried rather than on something that can be further researched or attempted by yourself?

I’m sorry but I didn’t understand,I’m still new to scripting .If you can explain this in a simpler way I would be very thankful,I searched this up and i didn’t find anything,I tried to mix up the touch script (the script that tell the system if the part is touched) and the coregui script (that script that enables and disables the backpack gui )but it didn’t work .

^ You can also try debugging your code. Saying “it doesn’t work” isn’t a sufficient enough explanation of how your attempted implementation failed. Details are needed when posting to this category.

Once again, please do your own research and testing first. If you’re unfamiliar with scripting or the terminology used, you can also use Google to look for those terms. You should at least have a fundamental understanding of some of the things you want to do before doing them, otherwise you run into these kinds of issues like understanding what to do and later, for maintenance problems.

I won’t be giving any code for this since this can be researched. There won’t necessarily be a tutorial or detailed explanation for everything you want to do, it’s up to you to learn and break things apart to piece them together. As for explanation’s sake, I feel like I’ve explained it in the simplest possible terms I can put it in. Good luck then!

1 Like