Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you access tool slots, the number slots at the bottom of the screen?

So let's say I wanted to create a whole new slot with new items just by pressing e How do I access that slot or all the slots? How do I change the tool on the player slot?

1 answer

✓ Accepted answer

Use a for loop.

e.g

player = yourplayervariablehere

for index,item in pairs(game.Players[player.Name].Backpack:GetChildren()) do

	if index == 2 then item:Destroy()
	
end

The index number is how many times the loop has ran. The loop runs once 'for' each item in the table. so if index was 2, that would be our second tool.

5 comments

0

-1 for "game.Players[player.Name]", use player.Backpack

0

And what's the issue with that and why did it deserve a downvote?

1

You wonder why you get targeted but you downvote people who actually write scripts and try to help because you didn't like one thing about? Especially in my case, you downvoted me because I used a different method of getting the player that is generally a good fail safe and you proposed a different way of doing it that wouldn't have changed the result at all. You honestly seem like a D dude. And

0

I didn't downgrade anything. If i did i must have done it on accident because i'm new to this whole script helpers site and don't understand some properties

0

Not you, the guy above my reply

This discussion is preserved as it was. New answers, comments, and votes are closed.