Advertisement
Uuuuh

Жизнь прижок скорость

May 19th, 2024
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.00 KB | Food | 0 0
  1. -- Получаем доступ к игроку и его персонажу
  2. local player = game.Players.LocalPlayer
  3. local character = player.Character or player.CharacterAdded:Wait()
  4.  
  5. -- Проверяем и создаем GUI, если его нет
  6. local function createPlayerGui()
  7.     local screenGui = player:FindFirstChild("PlayerGui"):FindFirstChild("PlayerControlGui")
  8.    
  9.     if not screenGui then
  10.         screenGui = Instance.new("ScreenGui")
  11.         screenGui.Name = "PlayerControlGui"
  12.         screenGui.Parent = player:FindFirstChild("PlayerGui")
  13.        
  14.         local frame = Instance.new("Frame")
  15.         frame.Size = UDim2.new(0, 180, 0, 120)
  16.         frame.Position = UDim2.new(0, 10, 0, 10)
  17.         frame.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
  18.         frame.BackgroundTransparency = 0.5
  19.         frame.BorderSizePixel = 0
  20.         frame.Parent = screenGui
  21.  
  22.         -- Функция для создания полей ввода
  23.         local function createTextBox(labelText, defaultText, positionY, callback)
  24.             local label = Instance.new("TextLabel")
  25.             label.Size = UDim2.new(0.5, 0, 0.3, 0)
  26.             label.Position = UDim2.new(0, 0, positionY, 0)
  27.             label.Text = labelText
  28.             label.TextColor3 = Color3.new(1, 1, 1)
  29.             label.BackgroundTransparency = 1
  30.             label.Font = Enum.Font.SourceSans
  31.             label.TextScaled = true
  32.             label.Parent = frame
  33.  
  34.             local textBox = Instance.new("TextBox")
  35.             textBox.Size = UDim2.new(0.5, -10, 0.3, 0)
  36.             textBox.Position = UDim2.new(0.5, 10, positionY, 0)
  37.             textBox.Text = defaultText
  38.             textBox.TextColor3 = Color3.new(1, 1, 1)
  39.             textBox.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
  40.             textBox.Font = Enum.Font.SourceSans
  41.             textBox.TextScaled = true
  42.             textBox.Parent = frame
  43.            
  44.             textBox.FocusLost:Connect(function()
  45.                 local newValue = tonumber(textBox.Text)
  46.                 if newValue then
  47.                     callback(newValue)
  48.                 else
  49.                     textBox.Text = defaultText
  50.                 end
  51.             end)
  52.         end
  53.  
  54.         createTextBox("Speed", "16", 0, function(newSpeed)
  55.             character.Humanoid.WalkSpeed = newSpeed
  56.         end)
  57.        
  58.         createTextBox("Jump", "50", 0.35, function(newJumpPower)
  59.             character.Humanoid.JumpPower = newJumpPower
  60.         end)
  61.        
  62.         createTextBox("Health", "100", 0.7, function(newHealth)
  63.             character.Humanoid.Health = newHealth
  64.         end)
  65.     end
  66.    
  67.     -- Создаем водяной знак
  68.     local watermark = Instance.new("TextLabel")
  69.     watermark.Size = UDim2.new(0, 200, 0, 50)
  70.     watermark.Position = UDim2.new(0, 10, 1, -60)  -- Позиция внизу экрана
  71.     watermark.Text = "by Xande | Scripts!"
  72.     watermark.TextColor3 = Color3.new(1, 1, 1)
  73.     watermark.BackgroundTransparency = 1
  74.     watermark.Font = Enum.Font.SourceSansBold
  75.     watermark.TextScaled = true
  76.     watermark.Parent = screenGui
  77. end
  78.  
  79. -- Проверяем и создаем CFrame, если его нет
  80. local function setupCFrame()
  81.     if not character:FindFirstChild("HumanoidRootPart") then
  82.         local rootPart = Instance.new("Part")
  83.         rootPart.Name = "HumanoidRootPart"
  84.         rootPart.Size = Vector3.new(2, 2, 1)
  85.         rootPart.Anchored = true
  86.         rootPart.CFrame = CFrame.new(0, 5, 0)
  87.         rootPart.Parent = character
  88.     end
  89. end
  90.  
  91. -- Основная функция для настройки
  92. local function setupPlayer()
  93.     character:WaitForChild("Humanoid") -- Ждем пока Humanoid будет доступен
  94.     createPlayerGui()
  95.     setupCFrame()
  96. end
  97.  
  98. -- Вызываем основную функцию
  99. setupPlayer()
  100.  
  101. -- Подписываемся на событие изменения персонажа
  102. player.CharacterAdded:Connect(function(char)
  103.     character = char
  104.     setupPlayer()
  105. end)
Tags: Скрипт
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement