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
Do something like this (you may need to make a couple changes)
1 | script.Parent.Parent.TextLabel.TButton.MouseButton 1 Click:Connect( function () |
2 | local player = game.Players:WaitForChild(script.Parent.Parent.TextLabel.Text) |
3 | -- then do something like this |
4 | local Item = script.Tool:Clone() |
5 | -- assuming the tool/item is inside the script |
6 | Item.Parent = player.Backpack |
7 | end ) |
i hope this helps