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 4 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 4 years ago

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

Ad

Answer this question