Create

--// P E E X  H U B  -  VISUAL PET SANDBOX
--// CLIENT ONLY | SAFE | MODERN UI | FULL MERGED (MODEL-BASED)

local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local gui = Instance.new("ScreenGui", player.PlayerGui)
gui.Name = "PeexHubGUI"
gui.ResetOnSpawn = false

--------------------------------------------------
-- UTIL
--------------------------------------------------
local function corner(o,r)
    Instance.new("UICorner",o).CornerRadius = UDim.new(0,r)
end

local function tween(o,t,p)
    TweenService:Create(o,TweenInfo.new(t,Enum.EasingStyle.Quint,Enum.EasingDirection.Out),p):Play()
end

--------------------------------------------------
-- 🦖 SPLASH (SMALL DINO DROP)
--------------------------------------------------
local splash = Instance.new("Frame",gui)
splash.Size = UDim2.fromOffset(240,140)
splash.Position = UDim2.fromScale(0.5,0.45)
splash.AnchorPoint = Vector2.new(0.5,0.5)
splash.BackgroundColor3 = Color3.fromRGB(15,18,26)
corner(splash,16)

local logo = Instance.new("ImageLabel",splash)
logo.Image = "rbxassetid://7229442422"
logo.Size = UDim2.fromOffset(64,64)
logo.Position = UDim2.fromScale(0.5,-0.4)
logo.AnchorPoint = Vector2.new(0.5,0.5)
logo.BackgroundTransparency = 1

local text = Instance.new("TextLabel",splash)
text.Text = "PeexHub"
text.Font = Enum.Font.GothamBlack
text.TextSize = 18
text.Position = UDim2.fromScale(0.5,0.75)
text.AnchorPoint = Vector2.new(0.5,0.5)
text.BackgroundTransparency = 1

TweenService:Create(logo,TweenInfo.new(0.9,Enum.EasingStyle.Bounce),{
    Position = UDim2.fromScale(0.5,0.35)
}):Play()

task.spawn(function()
    local h = 0
    while splash.Parent do
        h = (h + 2) % 360
        text.TextColor3 = Color3.fromHSV(h/360,1,1)
        task.wait(0.04)
    end
end)

task.wait(1.4)
tween(splash,0.4,{BackgroundTransparency = 1})
tween(logo,0.4,{ImageTransparency = 1})
tween(text,0.4,{TextTransparency = 1})
task.wait(0.4)
splash:Destroy()

--------------------------------------------------
-- MAIN WINDOW
--------------------------------------------------
local main = Instance.new("Frame",gui)
main.Size = UDim2.fromOffset(560,320)
main.Position = UDim2.fromScale(0.5,0.5)
main.AnchorPoint = Vector2.new(0.5,0.5)
main.BackgroundColor3 = Color3.fromRGB(18,22,30)
main.BorderSizePixel = 0
corner(main,18)

-- RGB STROKE
local stroke = Instance.new("UIStroke",main)
stroke.Thickness = 2
task.spawn(function()
    local h = 0
    while main.Parent do
        h = (h + 1) % 360
        stroke.Color = Color3.fromHSV(h/360,1,1)
        task.wait(0.04)
    end
end)

--------------------------------------------------
-- HEADER
--------------------------------------------------
local header = Instance.new("Frame",main)
header.Size = UDim2.new(1,0,0,42)
header.BackgroundTransparency = 1

local title = Instance.new("TextLabel",header)
title.Text = "PeexHub"
title.Font = Enum.Font.GothamBlack
title.TextSize = 18
title.Position = UDim2.fromOffset(14,0)
title.Size = UDim2.new(1,-100,1,0)
title.BackgroundTransparency = 1

task.spawn(function()
    local h = 0
    while title.Parent do
        h = (h + 2) % 360
        title.TextColor3 = Color3.fromHSV(h/360,1,1)
        task.wait(0.05)
    end
end)

--------------------------------------------------
-- CLOSE & MINIMIZE
--------------------------------------------------
local function topBtn(txt,x)
    local b = Instance.new("TextButton",header)
    b.Text = txt
    b.Font = Enum.Font.GothamBold
    b.TextSize = 14
    b.Size = UDim2.fromOffset(28,28)
    b.Position = UDim2.fromOffset(x,7)
    b.BackgroundColor3 = Color3.fromRGB(40,45,60)
    b.TextColor3 = Color3.new(1,1,1)
    corner(b,8)
    return b
end

local minBtn = topBtn("-", main.Size.X.Offset - 70)
local closeBtn = topBtn("X", main.Size.X.Offset - 36)

closeBtn.MouseButton1Click:Connect(function()
    gui:Destroy()
end)

--------------------------------------------------
-- DRAG (MOUSE + TOUCH)
--------------------------------------------------
do
    local dragging = false
    local dragStart, startPos

    local function start(input)
        dragging = true
        dragStart = input.Position
        startPos = main.Position
    end

    local function move(input)
        if dragging then
            local delta = input.Position - dragStart
            main.Position = UDim2.new(
                startPos.X.Scale,
                startPos.X.Offset + delta.X,
                startPos.Y.Scale,
                startPos.Y.Offset + delta.Y
            )
        end
    end

    header.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1
        or input.UserInputType == Enum.UserInputType.Touch then
            start(input)
        end
    end)

    UIS.InputChanged:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseMovement
        or input.UserInputType == Enum.UserInputType.Touch then
            move(input)
        end
    end)

    UIS.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1
        or input.UserInputType == Enum.UserInputType.Touch then
            dragging = false
        end
    end)
end

--------------------------------------------------
-- MINIMIZE BUBBLE
--------------------------------------------------
local bubble = Instance.new("ImageButton",gui)
bubble.Image = "rbxassetid://7229442422"
bubble.Size = UDim2.fromOffset(60,60)
bubble.Position = UDim2.fromScale(0.5,0.8)
bubble.AnchorPoint = Vector2.new(0.5,0.5)
bubble.Visible = false
bubble.BackgroundColor3 = Color3.fromRGB(20,20,30)
corner(bubble,30)

minBtn.MouseButton1Click:Connect(function()
    main.Visible = false
    bubble.Visible = true
end)

bubble.MouseButton1Click:Connect(function()
    bubble.Visible = false
    main.Visible = true
end)

--------------------------------------------------
-- CONTENT
--------------------------------------------------
local scroll = Instance.new("ScrollingFrame",main)
scroll.Position = UDim2.fromOffset(14,50)
scroll.Size = UDim2.new(1,-28,1,-64)
scroll.CanvasSize = UDim2.new(0,0,0,0)
scroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
scroll.ScrollBarImageTransparency = 0.6
scroll.BackgroundTransparency = 1

local layout = Instance.new("UIListLayout",scroll)
layout.Padding = UDim.new(0,12)

--------------------------------------------------
-- VISUAL PET SYSTEM (MODEL ASLI GAME)
--------------------------------------------------
local VisualPets = {}
local CachedPets = {}

-- scan semua model pet di game
local function cachePets()
    table.clear(CachedPets)
    for _,v in ipairs(game:GetDescendants()) do
        if v:IsA("Model") and v:FindFirstChildWhichIsA("BasePart") then
            CachedPets[v.Name] = v
        end
    end
end
cachePets()

-- mutasi visual
local function applyMutation(model, mutation)
    for _,p in ipairs(model:GetDescendants()) do
        if p:IsA("BasePart") then
            if mutation == "Rainbow" then
                p.Material = Enum.Material.Neon
                task.spawn(function()
                    while model.Parent do
                        p.Color = Color3.fromHSV((tick()*0.25)%1,1,1)
                        task.wait(0.05)
                    end
                end)
            elseif mutation == "Golden" then
                p.Material = Enum.Material.Metal
                p.Color = Color3.fromRGB(255,215,0)
            end
        end
    end
end

-- spawn pet visual (model asli)
local function spawnPet(name, mutation)
    local src = CachedPets[name]
    if not src then
        warn("Pet model tidak ditemukan:", name)
        return
    end

    local clone = src:Clone()
    clone.Name = name .. "_VISUAL"
    clone.Parent = workspace

    if not clone.PrimaryPart then
        clone.PrimaryPart = clone:FindFirstChildWhichIsA("BasePart")
    end

    if mutation and mutation ~= "" then
        applyMutation(clone, mutation)
    end

    table.insert(VisualPets, clone)
end

-- orbit / equip visual
RunService.RenderStepped:Connect(function()
    local char = player.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    if not hrp then return end

    for i,pet in ipairs(VisualPets) do
        if pet.PrimaryPart then
            local a = tick()*1.4 + (i * math.pi*2 / #VisualPets)
            pet:PivotTo(
                hrp.CFrame *
                CFrame.new(math.cos(a)*3, 1.6, math.sin(a)*3)
            )
        end
    end
end)

-- clear all visual
local function clearVisualPets()
    for _,p in ipairs(VisualPets) do
        pcall(function() p:Destroy() end)
    end
    table.clear(VisualPets)
end

--------------------------------------------------
-- UI CARDS
--------------------------------------------------
local PETS = {"Frost Spirit","Gilded Seraphin","Christmas Tree"}

for _,pet in ipairs(PETS) do
    local card = Instance.new("Frame",scroll)
    card.Size = UDim2.new(1,0,0,70)
    card.BackgroundColor3 = Color3.fromRGB(28,33,45)
    corner(card,14)

    local lbl = Instance.new("TextLabel",card)
    lbl.Text = pet
    lbl.Font = Enum.Font.GothamBold
    lbl.TextSize = 15
    lbl.TextColor3 = Color3.fromRGB(210,225,255)
    lbl.Position = UDim2.fromOffset(12,6)
    lbl.BackgroundTransparency = 1
    lbl.Size = UDim2.new(1,-24,0,20)

    local amt = Instance.new("TextBox",card)
    amt.Text = "1"
    amt.Size = UDim2.fromOffset(50,26)
    amt.Position = UDim2.fromOffset(12,38)
    amt.BackgroundColor3 = Color3.fromRGB(40,45,60)
    amt.TextColor3 = Color3.new(1,1,1)
    corner(amt,8)

    local mut = Instance.new("TextBox",card)
    mut.PlaceholderText = "Mutasi (opsional)"
    mut.Size = UDim2.fromOffset(150,26)
    mut.Position = UDim2.fromOffset(70,38)
    mut.BackgroundColor3 = Color3.fromRGB(40,45,60)
    mut.TextColor3 = Color3.new(1,1,1)
    corner(mut,8)

    local btn = Instance.new("TextButton",card)
    btn.Text = "VISUAL"
    btn.Size = UDim2.fromOffset(80,26)
    btn.Position = UDim2.fromOffset(230,38)
    btn.BackgroundColor3 = Color3.fromRGB(90,120,255)
    btn.TextColor3 = Color3.new(1,1,1)
    corner(btn,10)

    btn.MouseButton1Click:Connect(function()
        tween(scroll,0.4,{CanvasPosition = Vector2.new(0,card.AbsolutePosition.Y)})
        local n = tonumber(amt.Text) or 1
        for i=1,math.clamp(n,1,10) do
            spawnPet(pet, mut.Text)
        end
    end)
end

-- OPTIONAL: bind delete all via key (Backspace)
UIS.InputBegan:Connect(function(i,gp)
    if gp then return end
    if i.KeyCode == Enum.KeyCode.Backspace then
        clearVisualPets()
    end
end)

Views: 61

Created At: 2025-12-29 10:34:12

View Raw Download Clone