SebTDZ

Two Player Execute Gui

Jun 28th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.18 KB | None | 0 0
  1. --Tool
  2. local Run = Instance.new("Tool", owner.Backpack)
  3. Run.Name = "Run"
  4.  
  5. local P = Instance.new("Part", Run)
  6. P.Name = "Handle"
  7. P.Size = Vector3.new(1,1,1)
  8.  
  9. local Player = Instance.new("Folder", Run)
  10. Player.Name = "Players"
  11.  
  12. local PlrNumb = Instance.new("IntValue", Run)
  13. PlrNumb.Name = "PlrNumb"
  14. PlrNumb.Value = 1
  15. --Gui
  16. local GuiScreen = Instance.new("ScreenGui", owner.PlayerGui)
  17. GuiScreen.Name = "RunGui"
  18. GuiScreen.Enabled = false
  19.  
  20. Run.Equipped:Connect(function(n)
  21.     GuiScreen.Enabled = true
  22. end)
  23. Run.Unequipped:Connect(function(n)
  24.     GuiScreen.Enabled = false
  25. end)
  26.  
  27. local GuiFrame = Instance.new("Frame", GuiScreen)
  28. GuiFrame.Size = UDim2.new(1, 0, 1, 0)
  29. GuiFrame.BackgroundTransparency = 0.55000001192093
  30.  
  31. local Text = Instance.new("TextLabel", GuiFrame)
  32. Text.Text = "Run"
  33. Text.BackgroundColor3 = Color3.new(0.384314, 0.384314, 0.384314)
  34. Text.BackgroundTransparency = 0.55000001192093
  35. Text.BorderSizePixel = 0
  36. Text.Size = UDim2.new(1, 0, 0.1, 0)
  37. Text.Font = Enum.Font.SciFi
  38. Text.TextSize = 50
  39.  
  40. local Button1 = Instance.new("TextButton", GuiFrame)
  41. Button1.Text = "nil"
  42. Button1.BackgroundColor3 = Color3.new(0.384314, 0.384314, 0.384314)
  43. Button1.BackgroundTransparency = 0.55000001192093
  44. Button1.BorderSizePixel = 0
  45. Button1.Position = UDim2.new(0.15, 0, 0.35, 0)
  46. Button1.Size = UDim2.new(0.35, 0, 0.1, 0)
  47. Button1.Font = Enum.Font.SciFi
  48. Button1.TextColor3 = Color3.new(0, 0, 0)
  49. Button1.TextSize = 50
  50. Button1.MouseButton1Click:Connect(function()
  51.     if PlrNumb.Value == 1 then
  52.         Button1.Text = Player.Player2.Value.Name
  53.         PlrNumb.Value = 3
  54.     elseif Player:FindFirstChild("Player" .. PlrNumb.Value) then
  55.         Button1.Text = Player:FindFirstChild("Player" .. PlrNumb.Value).Value.Name
  56.         PlrNumb.Value = PlrNumb.Value + 1
  57.     else
  58.         Button1.Text = Player.Player2.Value.Name
  59.         PlrNumb.Value = 3
  60.     end
  61. end)
  62.  
  63. local Button3 = Instance.new("TextButton", GuiFrame)
  64. Button3.Text = "Reload"
  65. Button3.BackgroundColor3 = Color3.new(0.384314, 0.384314, 0.384314)
  66. Button3.BackgroundTransparency = 0.55000001192093
  67. Button3.BorderSizePixel = 0
  68. Button3.Position = UDim2.new(0.15, 0, 0.45, 0)
  69. Button3.Size = UDim2.new(0.7, 0, 0.1, 0)
  70. Button3.Font = Enum.Font.SciFi
  71. Button3.TextColor3 = Color3.new(0, 0, 0)
  72. Button3.TextSize = 50
  73. Button3.MouseButton1Click:Connect(function()
  74.     for i,v in pairs(Player:GetChildren()) do
  75.         v:Remove()
  76.     end
  77.     local i = -1
  78.     for i,v in pairs(game.Players:GetChildren()) do
  79.         i = i + 1
  80.         local playerNew = Instance.new("ObjectValue", Player)
  81.         playerNew.Name = "Player" .. string.format(i)
  82.         playerNew.Value = v
  83.     end
  84.     Button1.Text = "nil"
  85.     Button2.Text = "nil"
  86.     PlrNumb.Value = 1
  87. end)
  88.  
  89. local Button4 = Instance.new("TextButton", GuiFrame)
  90. Button4.Text = "Execute"
  91. Button4.BackgroundColor3 = Color3.new(0.384314, 0.384314, 0.384314)
  92. Button4.BackgroundTransparency = 0.55000001192093
  93. Button4.BorderSizePixel = 0
  94. Button4.Position = UDim2.new(0.15, 0, 0.55, 0)
  95. Button4.Size = UDim2.new(0.7, 0, 0.1, 0)
  96. Button4.Font = Enum.Font.SciFi
  97. Button4.TextColor3 = Color3.new(0, 0, 0)
  98. Button4.TextSize = 50
  99. Button4.MouseButton1Click:Connect(function()
  100.     if game.Players:FindFirstChild(Button1.Text) then
  101.         execute(Button1.Text)
  102.     end
  103. end)
  104.  
  105. function execute(plr)
  106.     print(plr)
  107. end
Add Comment
Please, Sign In to add comment