script.Parent.MouseButton1Click:connect(function()
player=game.Players.LocalPlayer
if player.PlayerGui:FindFirstChild("SwordFightSelectionGui") then return end
local trainees={}
for i,v in pairs(game.Players:GetChildren())do
table.insert(trainees,v.Name)
end
wait()
local newgui=Instance.new("ScreenGui")
newgui.Parent=player.PlayerGui
newgui.Name="SwordFightSelectionGui"
textbox1=Instance.new("TextBox")
textbox1.Parent=newgui
textbox1.Position=UDim2.new(0.5,0,0.5,0)
textbox1.Size=UDim2.new(0.1,0,0.05,0)
textbox1.Text=""
textbox1.Name="PointA"
textbox1.TextScaled=true
textbox1.TextWrapped=true
textbox2=Instance.new("TextBox")
textbox2.Parent=newgui
textbox2.Position=UDim2.new(0.5,0,0.55,0)
textbox2.Size=UDim2.new(0.1,0,0.05,0)
textbox2.Text=""
textbox2.Name="PointB"
textbox2.TextScaled=true
textbox2.TextWrapped=true
donebutton=Instance.new("TextButton")
donebutton.Parent=newgui
donebutton.Position=UDim2.new(0.5,0,0.85,0)
donebutton.Size=UDim2.new(0.1,0,0.05,0)
donebutton.Text=""
donebutton.Name="DoneButton"
donebutton.TextScaled=true
donebutton.TextWrapped=true
donebutton.MouseButton1Down:connect(function()
for i,v in pairs(game.Players:GetPlayers())do
if v.Name==player.PlayerGui.SwordFightSelectionGui.PointA.Text then
playerA=v
end
if v.Name==player.PlayerGui.SwordFightSelectionGui.PointB.Text then
playerB=v
end
if playerA:IsA("Player") then
playerA.Character.Torso.Character=game.Workspace.PointA
end
if playerB:IsA("Player") then
playerB.Character.Torso.Character=game.Workspace.PointB
end
end
end)
wait()
for i,v in pairs(trainees) do
local textbutton=Instance.new("TextButton")
textbutton.Parent=newgui
textbutton.Text=v
textbutton.Size=UDim2.new(0.1,0,0.05,0)
textbutton.Position=UDim2.new(0.2,0,0.5+(i/20),0)
textbutton.MouseButton1Down:connect(function()
if player.PlayerGui.SwordFightSelectionGui.PointA.Text=="" then
player.PlayerGui.SwordFightSelectionGui.PointA.Text=textbutton.Text
elseif player.PlayerGui.SwordFightSelectionGui.PointB.Text=="" then
player.PlayerGui.SwordFightSelectionGui.PointB.Text=textbutton.Text
elseif player.PlayerGui.SwordFightSelectionGui.PointA.Text.Text~="" and player.PlayerGui.SwordFightSelectionGui.PointB.Text~="" then return end
end)
end
end)
When I try it, it thinks the players are parts so it will not get their characters to move to the proper place.
