Advertisement
Imakerblxscripts55

Untitled

Sep 18th, 2024
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. -- Create the ScreenGui
  2. local screenGui = Instance.new("ScreenGui")
  3. screenGui.Name = "BringGui"
  4. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  5.  
  6. -- Create the Frame
  7. local frame = Instance.new("Frame")
  8. frame.Size = UDim2.new(0, 300, 0, 150)
  9. frame.Position = UDim2.new(0.5, -150, 0.5, -75)
  10. frame.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
  11. frame.Parent = screenGui
  12.  
  13. -- Create the TextBox for player input
  14. local textBox = Instance.new("TextBox")
  15. textBox.Size = UDim2.new(0, 280, 0, 50)
  16. textBox.Position = UDim2.new(0, 10, 0, 20)
  17. textBox.PlaceholderText = "DisplayName/Name"
  18. textBox.Text = ""
  19. textBox.Parent = frame
  20.  
  21. -- Create the "Bring" button
  22. local bringButton = Instance.new("TextButton")
  23. bringButton.Size = UDim2.new(0, 280, 0, 50)
  24. bringButton.Position = UDim2.new(0, 10, 0, 80)
  25. bringButton.Text = "BRING"
  26. bringButton.Parent = frame
  27.  
  28. -- Bring function
  29. local function bringPlayer()
  30. local playerName = textBox.Text
  31. local targetPlayer = game.Players:FindFirstChild(playerName)
  32.  
  33. if targetPlayer and targetPlayer.Character then
  34. -- Move the target player's character to the local player's position
  35. targetPlayer.Character:SetPrimaryPartCFrame(game.Players.LocalPlayer.Character.PrimaryPart.CFrame)
  36. else
  37. print("Player not found or not in game.")
  38. end
  39. end
  40.  
  41. -- Connect the button to the bring function
  42. bringButton.MouseButton1Click:Connect(bringPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement