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

How can I select a player's HopperBin right when he gets it? [not solved]

Asked by
Tesouro 407 Moderation Voter
10 years ago

I have a script that clones a HopperBin into a player's Backpack and I want it to be selected in the moment he gets it, automatically, to prevent some errors. How can I do it? and about Tools, how to do the same? (with automatically, I mean without him clicking it)

0
I think the player has to click it himself i don't think you can automatically select a tool for a player but i'm not sure. Damo999 182 — 10y
0
Ow.. that is not good. Tesouro 407 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

To do this, I would use the 'Active property of a HopperBin. First, let's reference the target. I'll set it to nil, but you change it to the actual hopperbin.

HopperBin = nil;

Next, let's enable the property :

HopperBin.Active = true;

That should work, but I've never attempted this.

0
No, it doesn't work. Selecting it changes the property, but changing the property nothing happens. Tesouro 407 — 10y
0
Hmm, I would suggest the ToggleSelect() method, but that is protected so I have no clue. If you find out, please tell me. KOTwarrior 150 — 10y
0
:P Tesouro 407 — 10y
Ad
Log in to vote
0
Answered by 10 years ago
game.Players.LocalPlayer.Character.Humanoid:EquipTool(game.Players.LocalPlayer.Backpack.ToolNameHere)

Hope I helped!

0
game.Players.LocalPlayer.Character.Humanoid:EquipTool(game.Players.LocalPlayer.Backpack.ToolNameHere) fireboltofdeath 635 — 10y
0
I posted the script on a comment because you can't see the answer fully. And since it has LocalPlayer put in localscript Okay? fireboltofdeath 635 — 10y
0
But it may only work with tools... Though worth a try. fireboltofdeath 635 — 10y
0
Oh and you can also use UnequipTools to Unequip all tools the player has. fireboltofdeath 635 — 10y
View all comments (2 more)
0
But that only makes the tools go into player backpack, not select them. Tesouro 407 — 10y
0
No, it makes the player Equip the tool. And no it does not work with Hopperbins. It force equips. fireboltofdeath 635 — 10y

Answer this question