Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- local player = Players.LocalPlayer
- -- Цветовая палитра
- local colors = {
- background = Color3.fromRGB(30, 30, 46),
- header = Color3.fromRGB(49, 50, 68),
- button = Color3.fromRGB(69, 71, 90),
- buttonHover = Color3.fromRGB(88, 91, 112),
- accent = Color3.fromRGB(137, 180, 250),
- text = Color3.fromRGB(240, 240, 255), -- Более белый текст
- close = Color3.fromRGB(243, 139, 168),
- waypoint = Color3.fromRGB(166, 227, 161)
- }
- -- Создаем GUI
- local gui = Instance.new("ScreenGui")
- gui.Name = "EnhancedMiniMap"
- gui.ResetOnSpawn = false
- gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- gui.Parent = player:WaitForChild("PlayerGui")
- -- Основной фрейм карты
- local mapFrame = Instance.new("Frame")
- mapFrame.Name = "MiniMap"
- mapFrame.Size = UDim2.new(0.25, 0, 0.35, 0)
- mapFrame.Position = UDim2.new(0.02, -50, 0.6, 0)
- mapFrame.BackgroundColor3 = colors.background
- mapFrame.BackgroundTransparency = 1
- mapFrame.ClipsDescendants = true
- mapFrame.Parent = gui
- -- Скругление углов
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 0)
- corner.Parent = mapFrame
- -- Тень
- local shadow = Instance.new("ImageLabel")
- shadow.Name = "Shadow"
- shadow.Image = "rbxassetid://1316045217"
- shadow.ImageColor3 = Color3.new(0, 0, 0)
- shadow.ImageTransparency = 1
- shadow.ScaleType = Enum.ScaleType.Slice
- shadow.SliceCenter = Rect.new(10, 10, 118, 118)
- shadow.Size = UDim2.new(1, 20, 1, 20)
- shadow.Position = UDim2.new(0, -10, 0, -10)
- shadow.BackgroundTransparency = 1
- shadow.Parent = mapFrame
- shadow.ZIndex = -1
- -- Заголовок
- local header = Instance.new("TextButton") -- Изменено на TextButton для перетаскивания
- header.Name = "Header"
- header.Size = UDim2.new(1, 0, 0.12, 0)
- header.Position = UDim2.new(0, 0, 0, -50)
- header.BackgroundColor3 = colors.header
- header.BackgroundTransparency = 1
- header.Text = ""
- header.AutoButtonColor = false
- header.Parent = mapFrame
- local headerCorner = Instance.new("UICorner")
- headerCorner.CornerRadius = UDim.new(0, 0)
- headerCorner.Parent = header
- -- Текст заголовка
- local title = Instance.new("TextLabel")
- title.Name = "Title"
- title.Size = UDim2.new(0.7, 0, 1, 0)
- title.Position = UDim2.new(0.15, 0, 0, 0)
- title.Text = "МИНИ-КАРТА"
- title.TextColor3 = colors.text
- title.TextSize = 16
- title.Font = Enum.Font.GothamBold
- title.TextTransparency = 1
- title.BackgroundTransparency = 1
- title.Parent = header
- -- Кнопка закрытия (теперь это ImageButton)
- local closeButton = Instance.new("ImageButton")
- closeButton.Name = "CloseButton"
- closeButton.Size = UDim2.new(0.1, 0, 1, 0)
- closeButton.Position = UDim2.new(0.9, 0, 0, 0)
- closeButton.Image = "rbxassetid://3926305904"
- closeButton.ImageRectOffset = Vector2.new(284, 4)
- closeButton.ImageRectSize = Vector2.new(24, 24)
- closeButton.ImageColor3 = colors.close
- closeButton.ImageTransparency = 1
- closeButton.BackgroundTransparency = 1
- closeButton.Parent = header
- -- Контейнер для точек
- local pointsContainer = Instance.new("ScrollingFrame")
- pointsContainer.Name = "PointsContainer"
- pointsContainer.Size = UDim2.new(1, -10, 0.65, 0)
- pointsContainer.Position = UDim2.new(0, 5, 0.15, 0)
- pointsContainer.BackgroundTransparency = 1
- pointsContainer.ScrollBarThickness = 4
- pointsContainer.ScrollBarImageColor3 = colors.accent
- pointsContainer.CanvasSize = UDim2.new(0, 0, 0, 0)
- pointsContainer.ScrollingDirection = Enum.ScrollingDirection.Y
- pointsContainer.Parent = mapFrame
- pointsContainer.ScrollBarImageTransparency = 1
- local pointsLayout = Instance.new("UIListLayout")
- pointsLayout.Padding = UDim.new(0, 8)
- pointsLayout.Parent = pointsContainer
- -- Таблица для хранения точек
- local waypoints = {}
- -- Функция обновления размера контейнера
- local function updateContainerSize()
- pointsContainer.CanvasSize = UDim2.new(0, 0, 0, pointsLayout.AbsoluteContentSize.Y)
- end
- pointsLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(updateContainerSize)
- -- Функция создания анимированной кнопки (ИСПРАВЛЕННАЯ ВЕРСИЯ)
- local function createAnimatedButton(name, parent, color)
- -- Основная кнопка (теперь TextButton)
- local button = Instance.new("TextButton")
- button.Name = name
- button.Size = UDim2.new(1, 0, 0, 45)
- button.BackgroundTransparency = 1
- button.Text = ""
- button.AutoButtonColor = false
- button.Parent = parent
- -- Внутренний фон кнопки
- local buttonBg = Instance.new("Frame")
- buttonBg.Name = "Background"
- buttonBg.Size = UDim2.new(1, 0, 1, 0)
- buttonBg.Position = UDim2.new(0, 0, 0, 0)
- buttonBg.BackgroundColor3 = color or colors.button
- buttonBg.BackgroundTransparency = 1
- buttonBg.Parent = button
- local buttonCorner = Instance.new("UICorner")
- buttonCorner.CornerRadius = UDim.new(0, 8)
- buttonCorner.Parent = buttonBg
- local buttonStroke = Instance.new("UIStroke")
- buttonStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- buttonStroke.Color = colors.accent
- buttonStroke.Transparency = 1
- buttonStroke.Thickness = 1
- buttonStroke.Parent = buttonBg
- -- Текст кнопки
- local buttonTitle = Instance.new("TextLabel")
- buttonTitle.Name = "Title"
- buttonTitle.Size = UDim2.new(0.8, 0, 0.8, 0)
- buttonTitle.Position = UDim2.new(0.1, 0, 0.1, 0)
- buttonTitle.Text = name
- buttonTitle.TextColor3 = colors.text
- buttonTitle.TextSize = 14
- buttonTitle.Font = Enum.Font.GothamMedium
- buttonTitle.TextXAlignment = Enum.TextXAlignment.Left
- buttonTitle.BackgroundTransparency = 1
- buttonTitle.TextTransparency = 1
- buttonTitle.Parent = buttonBg
- -- Иконка кнопки
- local buttonIcon = Instance.new("ImageLabel")
- buttonIcon.Name = "Icon"
- buttonIcon.Size = UDim2.new(0, 20, 0, 20)
- buttonIcon.Position = UDim2.new(0.85, 0, 0.5, -10)
- buttonIcon.Image = "rbxassetid://3926305904"
- buttonIcon.ImageRectOffset = Vector2.new(324, 364)
- buttonIcon.ImageRectSize = Vector2.new(16, 16)
- buttonIcon.ImageColor3 = colors.text
- buttonIcon.ImageTransparency = 1
- buttonIcon.BackgroundTransparency = 1
- buttonIcon.Parent = buttonBg
- -- Анимация появления
- local bgTween = TweenService:Create(buttonBg, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0})
- local textTween = TweenService:Create(buttonTitle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0})
- local iconTween = TweenService:Create(buttonIcon, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {ImageTransparency = 0.5})
- local strokeTween = TweenService:Create(buttonStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0.7})
- task.spawn(function()
- bgTween:Play()
- task.wait(0.1)
- textTween:Play()
- strokeTween:Play()
- task.wait(0.1)
- iconTween:Play()
- end)
- -- Анимация наведения
- button.MouseEnter:Connect(function()
- TweenService:Create(buttonBg, TweenInfo.new(0.2, Enum.EasingStyle.Quad), {
- BackgroundColor3 = colors.buttonHover,
- Size = UDim2.new(1, 5, 1, 5),
- Position = UDim2.new(0, -2.5, 0, -2.5)
- }):Play()
- TweenService:Create(buttonIcon, TweenInfo.new(0.3, Enum.EasingStyle.Back), {
- ImageTransparency = 0,
- Rotation = 360
- }):Play()
- end)
- button.MouseLeave:Connect(function()
- TweenService:Create(buttonBg, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
- BackgroundColor3 = color or colors.button,
- Size = UDim2.new(1, 0, 1, 0),
- Position = UDim2.new(0, 0, 0, 0)
- }):Play()
- TweenService:Create(buttonIcon, TweenInfo.new(0.3, Enum.EasingStyle.Back), {
- ImageTransparency = 0.5,
- Rotation = 0
- }):Play()
- end)
- -- Эффект нажатия
- local clickEffect = Instance.new("Frame")
- clickEffect.Name = "ClickEffect"
- clickEffect.Size = UDim2.new(0, 0, 0, 0)
- clickEffect.Position = UDim2.new(0.5, 0, 0.5, 0)
- clickEffect.BackgroundColor3 = Color3.new(1, 1, 1)
- clickEffect.BackgroundTransparency = 0.8
- clickEffect.BorderSizePixel = 0
- clickEffect.Parent = buttonBg
- clickEffect.ZIndex = 5
- local effectCorner = Instance.new("UICorner")
- effectCorner.CornerRadius = UDim.new(1, 0)
- effectCorner.Parent = clickEffect
- button.MouseButton1Down:Connect(function()
- clickEffect.Size = UDim2.new(0, 0, 0, 0)
- clickEffect.Position = UDim2.new(0.5, 0, 0.5, 0)
- clickEffect.BackgroundTransparency = 0.8
- TweenService:Create(clickEffect, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- Size = UDim2.new(2, 0, 2, 0),
- Position = UDim2.new(-0.5, 0, -0.5, 0),
- BackgroundTransparency = 1
- }):Play()
- end)
- return button, buttonBg
- end
- -- Функция добавления точки телепортации
- local function addWaypoint(name, position, color)
- local button, buttonBg = createAnimatedButton(name, pointsContainer, color or colors.waypoint)
- button.MouseButton1Click:Connect(function()
- -- Анимация нажатия
- TweenService:Create(buttonBg, TweenInfo.new(0.2, Enum.EasingStyle.Quad), {
- BackgroundColor3 = colors.accent
- }):Play()
- -- Телепортация с задержкой
- task.delay(0.3, function()
- local character = player.Character
- if character and character:FindFirstChild("HumanoidRootPart") then
- character.HumanoidRootPart.CFrame = CFrame.new(position)
- -- Эффект телепортации
- local teleportEffect = Instance.new("Frame")
- teleportEffect.Size = UDim2.new(1, 10, 0, 3)
- teleportEffect.Position = UDim2.new(0, -5, 1, 0)
- teleportEffect.BackgroundColor3 = colors.accent
- teleportEffect.BorderSizePixel = 0
- teleportEffect.Parent = buttonBg
- local teleportCorner = Instance.new("UICorner")
- teleportCorner.CornerRadius = UDim.new(0, 2)
- teleportCorner.Parent = teleportEffect
- TweenService:Create(teleportEffect, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- BackgroundTransparency = 1
- }):Play()
- game.Debris:AddItem(teleportEffect, 0.5)
- end
- end)
- -- Возврат цвета
- task.delay(0.5, function()
- TweenService:Create(buttonBg, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
- BackgroundColor3 = color or colors.waypoint
- }):Play()
- end)
- end)
- table.insert(waypoints, {
- name = name,
- position = position,
- button = button
- })
- updateContainerSize()
- end
- -- Функция удаления точки
- local function removeWaypoint(name)
- for i, wp in ipairs(waypoints) do
- if wp.name == name then
- -- Анимация удаления
- TweenService:Create(wp.button, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
- BackgroundTransparency = 1,
- Size = UDim2.new(0, 0, 0, 0)
- }):Play()
- task.delay(0.3, function()
- wp.button:Destroy()
- table.remove(waypoints, i)
- updateContainerSize()
- end)
- break
- end
- end
- end
- -- Панель управления
- local controlPanel = Instance.new("Frame")
- controlPanel.Name = "ControlPanel"
- controlPanel.Size = UDim2.new(1, -10, 0.1, 0)
- controlPanel.Position = UDim2.new(0, 5, 0.85, 0)
- controlPanel.BackgroundTransparency = 1
- controlPanel.Parent = mapFrame
- -- Кнопка добавления
- local addButton, addButtonBg = createAnimatedButton("Добавить точку", controlPanel, colors.accent)
- addButton.Size = UDim2.new(0.48, 0, 1, 0)
- addButton.Position = UDim2.new(0, 0, 0, 0)
- addButtonBg.Title.Text = "Добавить"
- addButton.MouseButton1Click:Connect(function()
- local character = player.Character
- if character and character:FindFirstChild("HumanoidRootPart") then
- local pointName = "Точка " .. (#waypoints + 1)
- addWaypoint(pointName, character.HumanoidRootPart.Position)
- -- Анимация подтверждения
- TweenService:Create(addButtonBg, TweenInfo.new(0.2, Enum.EasingStyle.Quad), {
- BackgroundColor3 = colors.waypoint
- }):Play()
- task.delay(0.5, function()
- TweenService:Create(addButtonBg, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
- BackgroundColor3 = colors.accent
- }):Play()
- end)
- end
- end)
- -- Кнопка удаления
- local removeButton, removeButtonBg = createAnimatedButton("Удалить точку", controlPanel, colors.close)
- removeButton.Size = UDim2.new(0.48, 0, 1, 0)
- removeButton.Position = UDim2.new(0.52, 0, 0, 0)
- removeButtonBg.Title.Text = "Удалить"
- removeButton.MouseButton1Click:Connect(function()
- if #waypoints > 0 then
- removeWaypoint(waypoints[#waypoints].name)
- -- Анимация подтверждения
- TweenService:Create(removeButtonBg, TweenInfo.new(0.2, Enum.EasingStyle.Quad), {
- BackgroundColor3 = Color3.new(0.5, 0, 0)
- }):Play()
- task.delay(0.5, function()
- TweenService:Create(removeButtonBg, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
- BackgroundColor3 = colors.close
- }):Play()
- end)
- end
- end)
- -- Анимации появления интерфейса
- local showTween = TweenService:Create(mapFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- Position = UDim2.new(0.02, 0, 0.6, 0),
- BackgroundTransparency = 0.15
- })
- local cornerTween = TweenService:Create(corner, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {
- CornerRadius = UDim.new(0, 12)
- })
- local shadowTween = TweenService:Create(shadow, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {
- ImageTransparency = 0.8,
- Size = UDim2.new(1, 10, 1, 10),
- Position = UDim2.new(0, -5, 0, -5)
- })
- local headerTween = TweenService:Create(header, TweenInfo.new(0.6, Enum.EasingStyle.Back), {
- Position = UDim2.new(0, 0, 0, 0),
- BackgroundTransparency = 0
- })
- local titleTween = TweenService:Create(title, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {
- TextTransparency = 0
- })
- local closeTween = TweenService:Create(closeButton, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {
- ImageTransparency = 0
- })
- local scrollTween = TweenService:Create(pointsContainer, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- ScrollBarImageTransparency = 0.3
- })
- -- Запуск анимаций
- task.delay(0.1, function()
- showTween:Play()
- cornerTween:Play()
- task.delay(0.2, function()
- shadowTween:Play()
- headerTween:Play()
- task.delay(0.2, function()
- titleTween:Play()
- closeTween:Play()
- task.delay(0.5, function()
- scrollTween:Play()
- -- Добавляем начальные точки
- task.delay(0.5, function()
- addWaypoint("Главный спавн", Vector3.new(0, 5, 0), colors.accent)
- task.delay(0.2, function()
- addWaypoint("Арена битв", Vector3.new(50, 10, 50), colors.close)
- task.delay(0.2, function()
- addWaypoint("Магазин", Vector3.new(-30, 5, 40), colors.waypoint)
- end)
- end)
- end)
- end)
- end)
- end)
- end)
- -- Перемещение GUI
- local dragging, dragInput, dragStart, startPos
- header.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = mapFrame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- header.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement then
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- local delta = input.Position - dragStart
- mapFrame.Position = UDim2.new(
- startPos.X.Scale,
- startPos.X.Offset + delta.X,
- startPos.Y.Scale,
- startPos.Y.Offset + delta.Y
- )
- end
- end)
- -- Сворачивание/разворачивание
- local isVisible = true
- closeButton.MouseButton1Click:Connect(function()
- isVisible = not isVisible
- if isVisible then
- -- Анимация появления
- mapFrame.Visible = true
- closeButton.Image = "rbxassetid://3926305904"
- closeButton.ImageRectOffset = Vector2.new(284, 4)
- showTween:Play()
- cornerTween:Play()
- task.delay(0.2, function()
- shadowTween:Play()
- headerTween:Play()
- task.delay(0.2, function()
- titleTween:Play()
- closeTween:Play()
- end)
- end)
- else
- -- Анимация исчезновения
- local hideTween = TweenService:Create(mapFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- Position = UDim2.new(0.02, -50, 0.6, 0),
- BackgroundTransparency = 1
- })
- local cornerHide = TweenService:Create(corner, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- CornerRadius = UDim.new(0, 0)
- })
- local shadowHide = TweenService:Create(shadow, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- ImageTransparency = 1,
- Size = UDim2.new(1, 20, 1, 20),
- Position = UDim2.new(0, -10, 0, -10)
- })
- local headerHide = TweenService:Create(header, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- Position = UDim2.new(0, 0, 0, -50),
- BackgroundTransparency = 1
- })
- local titleHide = TweenService:Create(title, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- TextTransparency = 1
- })
- local closeHide = TweenService:Create(closeButton, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {
- ImageTransparency = 1
- })
- closeHide:Play()
- titleHide:Play()
- headerHide:Play()
- shadowHide:Play()
- cornerHide:Play()
- hideTween:Play()
- task.delay(0.5, function()
- mapFrame.Visible = false
- -- Кнопка для повторного открытия
- local reopenButton = Instance.new("ImageButton")
- reopenButton.Name = "ReopenButton"
- reopenButton.Size = UDim2.new(0, 40, 0, 40)
- reopenButton.Position = UDim2.new(0.02, 0, 0.6, 0)
- reopenButton.Image = "rbxassetid://3926305904"
- reopenButton.ImageRectOffset = Vector2.new(84, 44)
- reopenButton.ImageRectSize = Vector2.new(36, 36)
- reopenButton.ImageColor3 = colors.accent
- reopenButton.BackgroundTransparency = 1
- reopenButton.Parent = gui
- local reopenCorner = Instance.new("UICorner")
- reopenCorner.CornerRadius = UDim.new(0, 8)
- reopenCorner.Parent = reopenButton
- reopenButton.MouseButton1Click:Connect(function()
- isVisible = true
- reopenButton:Destroy()
- closeButton.Image = "rbxassetid://3926305904"
- closeButton.ImageRectOffset = Vector2.new(284, 4)
- mapFrame.Visible = true
- showTween:Play()
- cornerTween:Play()
- task.delay(0.2, function()
- shadowTween:Play()
- headerTween:Play()
- task.delay(0.2, function()
- titleTween:Play()
- closeTween:Play()
- end)
- end)
- end)
- end)
- end
- end)
Add Comment
Please, Sign In to add comment