Advertisement
Guest User

Player Controling Script Roblox Gui

a guest
Jun 2nd, 2018
6,937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. spawn (function()
  2. -- Objects
  3. plr = game.Players.LocalPlayer
  4. ControlGui = Instance.new("ScreenGui")
  5. Frame = Instance.new("Frame")
  6. TextButton = Instance.new("TextButton")
  7. TextBox = Instance.new("TextBox")
  8.  
  9. -- Properties
  10.  
  11. ControlGui.Name = "ControlGui"
  12. ControlGui.Parent = plr.PlayerGui
  13.  
  14. Frame.Parent = ControlGui
  15. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  16. Frame.Position = UDim2.new(0, 300, 0, 200)
  17. Frame.Size = UDim2.new(0, 300, 0, 150)
  18. Frame.Active = true
  19. Frame.Draggable = true
  20.  
  21. TextButton.Parent = Frame
  22. TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
  23. TextButton.Position = UDim2.new(0, 50, 0, 90)
  24. TextButton.Size = UDim2.new(0, 200, 0, 50)
  25. TextButton.Font = Enum.Font.SourceSans
  26. TextButton.FontSize = Enum.FontSize.Size32
  27. TextButton.Text = "Control"
  28. TextButton.TextSize = 30
  29. TextButton.MouseButton1Down:connect(function()
  30. if TextButton.Text == "Control" then
  31. TextButton.Text = "UnControl"
  32. workspace[TextBox.Text].Humanoid.PlatformStand = true
  33. W1 = Instance.new("Weld",workspace)
  34. W1.Name = "Weld1"
  35. W1.Part0 = plr.Character.Torso
  36. W1.Part1 = workspace[TextBox.Text].Torso
  37. W2 = Instance.new("Weld",workspace)
  38. W2.Name = "Weld2"
  39. W2.Part0 = plr.Character.Head
  40. W2.Part1 = workspace[TextBox.Text].Head
  41. W3 = Instance.new("Weld",workspace)
  42. W3.Name = "Weld3"
  43. W3.Part0 = plr.Character.HumanoidRootPart
  44. W3.Part1 = workspace[TextBox.Text].HumanoidRootPart
  45. W4 = Instance.new("Weld",workspace)
  46. W4.Name = "Weld4"
  47. W4.Part0 = plr.Character["Left Arm"]
  48. W4.Part1 = workspace[TextBox.Text]["Left Arm"]
  49. W5 = Instance.new("Weld",workspace)
  50. W5.Name = "Weld5"
  51. W5.Part0 = plr.Character["Left Leg"]
  52. W5.Part1 = workspace[TextBox.Text]["Left Leg"]
  53. W6 = Instance.new("Weld",workspace)
  54. W6.Name = "Weld6"
  55. W6.Part0 = plr.Character["Right Arm"]
  56. W6.Part1 = workspace[TextBox.Text]["Right Arm"]
  57. W7 = Instance.new("Weld",workspace)
  58. W7.Name = "Weld7"
  59. W7.Part0 = plr.Character["Right Leg"]
  60. W7.Part1 = workspace[TextBox.Text]["Right Leg"]
  61. for i,v in pairs(plr.Character:GetChildren()) do
  62. if v.ClassName == "Part" then
  63. v.Transparency = 1
  64. end
  65. plr.Character.HumanoidRootPart.Transparency = 1
  66. if v.ClassName == "Accessory" then
  67. v.Handle.Transparency = 1
  68. end
  69. plr.Character.Humanoid.NameOcclusion = "NoOcclusion"
  70. end
  71. elseif TextButton.Text == "UnControl" then
  72. TextButton.Text = "Control"
  73. workspace[TextBox.Text].Humanoid.PlatformStand = false
  74. workspace.Weld1:Remove()
  75. workspace.Weld2:Remove()
  76. workspace.Weld3:Remove()
  77. workspace.Weld4:Remove()
  78. workspace.Weld5:Remove()
  79. workspace.Weld6:Remove()
  80. workspace.Weld7:Remove()
  81. for i,v in pairs(plr.Character:GetChildren()) do
  82. if v.ClassName == "Part" then
  83. v.Transparency = 0
  84. end
  85. plr.Character.HumanoidRootPart.Transparency = 1
  86. if v.ClassName == "Accessory" then
  87. v.Handle.Transparency = 0
  88. end
  89. plr.Character.Humanoid.NameOcclusion = "OccludeAll"
  90. end
  91. end
  92. end)
  93.  
  94. TextBox.Parent = Frame
  95. TextBox.BackgroundColor3 = Color3.new(1, 1, 1)
  96. TextBox.Position = UDim2.new(0, 50, 0, 20)
  97. TextBox.Size = UDim2.new(0, 200, 0, 30)
  98. TextBox.Font = Enum.Font.SourceSans
  99. TextBox.FontSize = Enum.FontSize.Size28
  100. TextBox.Text = "Name"
  101. TextBox.TextSize = 25
  102. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement