Hey, im making GUI in my studio and i added an textbox and textbutton to the GUI. Im trying to make it so when i put a players name in the "textbox" and press the "textbutton" i would anchor the HEAD and not whole BODY. (im a beginner at scripting and sorry for bad english)
TButton.MouseButton1Click:connect(function()
local text_1 = AnchorP1.Text;
local Player_1 = game:GetService('Players'):FindFirstChild(text_1);
if Player_1 then
local char=Player_1.Character;
local gd_1=char:GetDescendants();
for _,v in pairs(gd_1)do
if v:IsA('BasePart')then
v.Anchored=true;
end;
end;
end;
end)

3 comments
This should work, if it doesn't let me know so I can fix it for you.
Thank you so much!
No problemo.