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

Locate a player via textlabel. Need help!?

Asked by 5 years ago

So I need help locating a player if they have their name on a textlabel. The text label's location is script.Parent.Parent.TextLabel . The text has the players name and if I click on a button it finds that player and gives them a item. The button is script.Parent.Parent.TextLabel.TButton

1 answer

Log in to vote
0
Answered by 5 years ago

Do something like this (you may need to make a couple changes)

1script.Parent.Parent.TextLabel.TButton.MouseButton1Click:Connect(function()
2local player = game.Players:WaitForChild(script.Parent.Parent.TextLabel.Text)
3-- then do something like this
4local Item = script.Tool:Clone()
5-- assuming the tool/item is inside the script
6Item.Parent = player.Backpack
7end)

i hope this helps

Ad

Answer this question