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

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

Asked by 4 years ago

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

Log in to vote
-1
Answered by
Gojinhan 353 Moderation Voter
4 years ago
Edited 4 years ago

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.

0
-1 for "game.Players[player.Name]", use player.Backpack programmerHere 371 — 4y
0
And what's the issue with that and why did it deserve a downvote? Gojinhan 353 — 4y
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 Gojinhan 353 — 4y
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 dakanji123 97 — 4y
0
Not you, the guy above my reply Gojinhan 353 — 4y
Ad

Answer this question