generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

specifying inventory slots?

Previous Thread :: Next Thread 
Xanth is not online. Xanth
Joined: 14 Oct 2007
Total Posts: 7691
24 Jul 2016 11:31 PM
Is there any way to make it so a tool automatically goes to a specific slot of your inventory (aka hotkeys 1-9)?
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
24 Jul 2016 11:35 PM
no


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
Xanth is not online. Xanth
Joined: 14 Oct 2007
Total Posts: 7691
24 Jul 2016 11:37 PM
are you positive?
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
24 Jul 2016 11:40 PM
Yes, there is a way but it's not a good way. I think your better option would be maybe to create your own custom inventory system or something.

Regardless, the way is this:
local inv = backpack:GetChildren()
for key = 1, #inv do
inv[key].Parent = nil
end
table.insert(inv, SLOTINDEX, tool)
for key = 1, #inv do
inv[key].Parent = backpack
end
Report Abuse
Xanth is not online. Xanth
Joined: 14 Oct 2007
Total Posts: 7691
24 Jul 2016 11:50 PM
why is that not a good way?
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
24 Jul 2016 11:51 PM
It just seems ugly to me. It's the only solution I could come up with so maybe there's another solution that doesn't feel as bad.
Report Abuse
Xanth is not online. Xanth
Joined: 14 Oct 2007
Total Posts: 7691
24 Jul 2016 11:53 PM
From what I can tell by the code, it just reorders the backback? That does sound clunky.
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
24 Jul 2016 11:55 PM
The order of the tools is determined by what GetChildren returns, which is in the order you parent things. So essentially I'm just parenting it in order again, but also with your custom tool in that specific slot you want (everything past will be shifted right one).
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
24 Jul 2016 11:56 PM
The problem with this method is that if people change it themselves, it'll ruin it for them (it'd go back in order). I don't know if you can get around fixing that without a custom backpack.
Report Abuse
Xanth is not online. Xanth
Joined: 14 Oct 2007
Total Posts: 7691
24 Jul 2016 11:57 PM
Okay so, say I make a custom inventory, would there be a way to change the hot key for a specific item to something other than the numbers? If there is I could probably figure it out or I will make another thread but I'm just wondering.
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
24 Jul 2016 11:58 PM
Yeah you can do whatever you want as long as you handle it correctly.
Report Abuse
Xanth is not online. Xanth
Joined: 14 Oct 2007
Total Posts: 7691
25 Jul 2016 12:00 AM
Alright, that's something I've never done so I'll probably have to spend a lot of time with it before it works properly.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image