local TARGET = script.Parent.PlayerName.Text
local plr = game.Players:FindFirstChild(TARGET)
local lpChar=game.Players.LocalPlayer.Character.Torso
if script.Parent.Command.Text == "bring" then
lpChar.Anchored = true
local w = Instance.new("Weld", lpChar)
w.Part0 = lpChar
w.Part1 = plr.Character.Torso
w.C0 = lpChar.CFrame
w.C1 = lpChar.CFrame
wait(.1)
w:Destroy()
lpChar.Anchored = false
end
if script.Parent.Command.Text == "kill" then
for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
if v.ClassName == 'Part' then
if v.Name ~= 'Head' then
v.Anchored = true
end
end
end
local w = Instance.new("Weld", lpChar)
w.Part0 = lpChar
w.Part1 = plr.Character.Torso
w.C0 = lpChar.CFrame
w.C1 = lpChar.CFrame * CFrame.new(0, -10000, 0)
wait(0.1)
w:Destroy()
for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
if v.ClassName == 'Part' then
if v.Name ~= 'Head' then
v.Anchored = false
end
end
end
end
Here's a photo of the GUI setup
I'm trying to make it so if you type a player's name in the "PlayerName" textbox, it'll run the kill script or bring script on that player if you type "kill" or "bring" in the Command textbox
