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
✓ ANSWER ACCEPTED
Locate a player via textlabel. Need help!?
1 answer
✓ Accepted answer
Do something like this (you may need to make a couple changes)
script.Parent.Parent.TextLabel.TButton.MouseButton1Click:Connect(function()
local player = game.Players:WaitForChild(script.Parent.Parent.TextLabel.Text)
-- then do something like this
local Item = script.Tool:Clone()
-- assuming the tool/item is inside the script
Item.Parent = player.Backpack
end)
i hope this helps
This discussion is preserved as it was. New answers, comments, and votes are closed.
