Hello, everyone. I wanted to make Hand To monitor. And I have problem. ChildAdded is not work I don't know why. I'm not getting Error.
Code: (LocalScript)
01 | local Player = game:GetService( "Players" ).LocalPlayer |
02 |
03 | game:GetService( "Players" ).ChildAdded:connect( function (child) |
04 | local Button = Instance.new( "TextButton" ,script.Parent.Main) |
05 | Button.Text = child.Name |
06 | Button.Name = child.Name |
07 | Button.TextScaled = true |
08 |
09 | Button.MouseButton 1 Click:connect( function () |
10 | if Player.Character:FindFirstChildOfClass( "Tool" ) then |
11 | local Tool = Player.Character:FindFirstChildOfClass( "Tool" ) |
12 | local GetClone = Tool:Clone() |
13 | GetClone.Parent = game:GetService( "Players" ):FindFirstChild(Button.Text).Backpack |
14 | end |
15 | end ) |
16 | end ) |
Your script is not working because a localscript can't do anything to other clients. Localscripts only work for their client. To fix this problem, I would use a server script instead.
Don't know what else to add, really. Ask if you have questions.