Advertisement
Uuuuh

Admin panel

May 19th, 2024 (edited)
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.99 KB | Gaming | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3. -- Создаем ScreenGui
  4. local screenGui = Instance.new("ScreenGui")
  5. screenGui.Name = "AdminPanel"
  6. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  7.  
  8. -- Создаем Frame для панели
  9. local frame = Instance.new("Frame")
  10. frame.Size = UDim2.new(0, 200, 0, 150)
  11. frame.Position = UDim2.new(0, 10, 0, 10)
  12. frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  13. frame.Parent = screenGui
  14.  
  15. -- Заголовок панели
  16. local title = Instance.new("TextLabel")
  17. title.Size = UDim2.new(1, 0, 0, 30)
  18. title.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  19. title.Text = "Admin Panel"
  20. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  21. title.Parent = frame
  22.  
  23. -- Текстовое поле для ввода имени
  24. local playerNameInput = Instance.new("TextBox")
  25. playerNameInput.Size = UDim2.new(1, -20, 0, 30)
  26. playerNameInput.Position = UDim2.new(0, 10, 0, 40)
  27. playerNameInput.PlaceholderText = "Enter Player Name"
  28. playerNameInput.Text = ""
  29. playerNameInput.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  30. playerNameInput.TextColor3 = Color3.fromRGB(255, 255, 255)
  31. playerNameInput.Parent = frame
  32.  
  33. -- Кнопка Teleport
  34. local teleportButton = Instance.new("TextButton")
  35. teleportButton.Size = UDim2.new(1, -20, 0, 30)
  36. teleportButton.Position = UDim2.new(0, 10, 0, 80)
  37. teleportButton.Text = "Teleport"
  38. teleportButton.BackgroundColor3 = Color3.fromRGB(0, 0, 255)
  39. teleportButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  40. teleportButton.Parent = frame
  41.  
  42. -- Водяной знак
  43. local watermark = Instance.new("TextLabel")
  44. watermark.Size = UDim2.new(1, 0, 0, 20)
  45. watermark.Position = UDim2.new(0, 0, 1, -20)
  46. watermark.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  47. watermark.Text = "by Xande | Scripts!"
  48. watermark.TextColor3 = Color3.fromRGB(255, 255, 255)
  49. watermark.TextScaled = true
  50. watermark.Parent = frame
  51.  
  52. -- Функция для телепортации администратора к игроку
  53. local function teleportToPlayer(targetPlayerName)
  54.     local targetPlayer = Players:FindFirstChild(targetPlayerName)
  55.     local localPlayer = Players.LocalPlayer
  56.  
  57.     if targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
  58.         local targetPosition = targetPlayer.Character.HumanoidRootPart.CFrame
  59.         if localPlayer.Character and localPlayer.Character:FindFirstChild("HumanoidRootPart") then
  60.             localPlayer.Character.HumanoidRootPart.CFrame = targetPosition
  61.         else
  62.             print("Local player's HumanoidRootPart not found.")
  63.         end
  64.     else
  65.         print("Target player or their HumanoidRootPart not found.")
  66.     end
  67. end
  68.  
  69. -- Обработчик нажатия кнопки Teleport
  70. teleportButton.MouseButton1Click:Connect(function()
  71.     local targetPlayerName = playerNameInput.Text
  72.     if targetPlayerName ~= "" then
  73.         teleportToPlayer(targetPlayerName)
  74.     else
  75.         print("Please enter a valid player name.")
  76.     end
  77. end)
Tags: Scripts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement