Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I detect when the backpack is opened or closed?

Asked by 5 years ago
Edited 5 years ago

Does anybody how to pass a signal when a player opens or closes the default roblox backpack, or if it's even possible? I'm trying to add an xp bar to the top of the backpack hotbar so I need to make it transparent or not visible when the backpack is opened, but I don't know how to detect when the backpack is toggled. Please help!

1 answer

Log in to vote
0
Answered by
N43FGXL 169
5 years ago

I don't believe there is a function for the player opening the backpack... I looked in the object browser which is a very useful source for looking for functions and properties of objects. There probably isn't a function for toggling it because it's in CoreGui.

But here are some solutions:

  1. Make a custom backpack with a GUI button. The GUI button will use the function "MouseButton1Click" or another function. That could trigger the backpack toggling.

  2. Make a key-press-event which there are many helpful Youtube tutorials. I think the button for opening the backpack is "~" but if your game is going to be on mobile you may run into issues with this.

I hope I've helped.

0
Only answer so far so ig I'll mark it as correct for now. Humanagon 5 — 5y
0
Thanks, sorry I didn't have much. N43FGXL 169 — 5y
Ad

Answer this question