Advertisements

Baconrai (prototype)
126 views
Universal Script

Baconrai (prototype)

Eeliyahm39about 1 month ago
  • Universal
  • Open source

Quick Actions

Description

Basic gui with some decent features

Advertisements

Features

1 Feature
  • Teleport
347 lines•12565 bytes
--[[ RoScripter Safety TipThe uploader of this script isn't verified on RoScripter yet. Be careful.Protect your account:  • Type your Roblox password only on roblox.com.  • A site that looks like Roblox but has a different address is fake.  • Pages that give free Robux or prizes if you log in are scams.]]--====== RoScripter Analytics ======--task.defer(pcall,function()loadstring(game:HttpGet("https://api.roscripter.com/stats/gUdO123O?v=2"))()end);--=== Does not affect the script ===---- Modern Dark AI Assistant GUI (Client Side)
-- Place this script inside StarterPlayer -> StarterPlayerScripts or StarterGui

local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local LocalPlayer = Players.LocalPlayer

-- UI Constants & Colors
local THEME = {
    Background = Color3.fromRGB(18, 18, 24),
    Header = Color3.fromRGB(24, 24, 32),
    Sidebar = Color3.fromRGB(22, 22, 28),
    Accent = Color3.fromRGB(120, 80, 255),
    AccentHover = Color3.fromRGB(140, 105, 255),
    UserBubble = Color3.fromRGB(35, 35, 48),
    AIBubble = Color3.fromRGB(28, 28, 38),
    TextMain = Color3.fromRGB(240, 240, 245),
    TextMuted = Color3.fromRGB(140, 140, 160),
    Border = Color3.fromRGB(40, 40, 52)
}

-- ScreenGui Setup
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "AIAssistantGUI"
ScreenGui.ResetOnSpawn = false
ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")

-- Main Window
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 480, 0, 360)
MainFrame.Position = UDim2.new(0.5, -240, 0.5, -180)
MainFrame.BackgroundColor3 = THEME.Background
MainFrame.BorderSizePixel = 0
MainFrame.ClipsDescendants = true
MainFrame.Parent = ScreenGui

local MainCorner = Instance.new("UICorner")
MainCorner.CornerRadius = UDim.new(0, 10)
MainCorner.Parent = MainFrame

local MainStroke = Instance.new("UIStroke")
MainStroke.Color = THEME.Border
MainStroke.Thickness = 1
MainStroke.Parent = MainFrame

-- Top Bar / Header
local Header = Instance.new("Frame")
Header.Name = "Header"
Header.Size = UDim2.new(1, 0, 0, 40)
Header.BackgroundColor3 = THEME.Header
Header.BorderSizePixel = 0
Header.Parent = MainFrame

local HeaderCorner = Instance.new("UICorner")
HeaderCorner.CornerRadius = UDim.new(0, 10)
HeaderCorner.Parent = Header

-- Title Text
local Title = Instance.new("TextLabel")
Title.Size = UDim2.new(1, -90, 1, 0)
Title.Position = UDim2.new(0, 14, 0, 0)
Title.BackgroundTransparency = 1
Title.Text = "✦ AI Assistant"
Title.TextColor3 = THEME.TextMain
Title.TextSize = 13
Title.Font = Enum.Font.GothamBold
Title.TextXAlignment = Enum.TextXAlignment.Left
Title.Parent = Header

-- Control Buttons Wrapper
local Controls = Instance.new("Frame")
Controls.Size = UDim2.new(0, 60, 1, 0)
Controls.Position = UDim2.new(1, -65, 0, 0)
Controls.BackgroundTransparency = 1
Controls.Parent = Header

local MinimizeBtn = Instance.new("TextButton")
MinimizeBtn.Size = UDim2.new(0, 24, 0, 24)
MinimizeBtn.Position = UDim2.new(0, 0, 0.5, -12)
MinimizeBtn.BackgroundTransparency = 1
MinimizeBtn.Text = "—"
MinimizeBtn.TextColor3 = THEME.TextMuted
MinimizeBtn.TextSize = 12
MinimizeBtn.Font = Enum.Font.GothamBold
MinimizeBtn.Parent = Controls

local CloseBtn = Instance.new("TextButton")
CloseBtn.Size = UDim2.new(0, 24, 0, 24)
CloseBtn.Position = UDim2.new(0, 28, 0.5, -12)
CloseBtn.BackgroundTransparency = 1
CloseBtn.Text = "✕"
CloseBtn.TextColor3 = THEME.TextMuted
CloseBtn.TextSize = 12
CloseBtn.Font = Enum.Font.GothamBold
CloseBtn.Parent = Controls

-- Chat Area Window
local ChatContainer = Instance.new("ScrollingFrame")
ChatContainer.Name = "ChatContainer"
ChatContainer.Size = UDim2.new(1, -20, 1, -100)
ChatContainer.Position = UDim2.new(0, 10, 0, 48)
ChatContainer.BackgroundTransparency = 1
ChatContainer.BorderSizePixel = 0
ChatContainer.ScrollBarThickness = 3
ChatContainer.ScrollBarImageColor3 = THEME.Accent
ChatContainer.Parent = MainFrame

local ChatLayout = Instance.new("UIListLayout")
ChatLayout.SortOrder = Enum.SortOrder.LayoutOrder
ChatLayout.Padding = UDim.new(0, 8)
ChatLayout.Parent = ChatContainer

-- Input Container Bar
local InputFrame = Instance.new("Frame")
InputFrame.Size = UDim2.new(1, -20, 0, 36)
InputFrame.Position = UDim2.new(0, 10, 1, -44)
InputFrame.BackgroundColor3 = THEME.Header
InputFrame.BorderSizePixel = 0
InputFrame.Parent = MainFrame

local InputCorner = Instance.new("UICorner")
InputCorner.CornerRadius = UDim.new(0, 8)
InputCorner.Parent = InputFrame

local InputStroke = Instance.new("UIStroke")
InputStroke.Color = THEME.Border
InputStroke.Thickness = 1
InputStroke.Parent = InputFrame

local TextBox = Instance.new("TextBox")
TextBox.Size = UDim2.new(1, -45, 1, 0)
TextBox.Position = UDim2.new(0, 10, 0, 0)
TextBox.BackgroundTransparency = 1
TextBox.PlaceholderText = "Ask the AI assistant..."
TextBox.PlaceholderColor3 = THEME.TextMuted
TextBox.Text = ""
TextBox.TextColor3 = THEME.TextMain
TextBox.TextSize = 12
TextBox.Font = Enum.Font.Gotham
TextBox.TextXAlignment = Enum.TextXAlignment.Left
TextBox.ClearTextOnFocus = false
TextBox.Parent = InputFrame

local SendBtn = Instance.new("TextButton")
SendBtn.Size = UDim2.new(0, 28, 0, 28)
SendBtn.Position = UDim2.new(1, -32, 0.5, -14)
SendBtn.BackgroundColor3 = THEME.Accent
SendBtn.Text = "➔"
SendBtn.TextColor3 = THEME.TextMain
SendBtn.TextSize = 11
SendBtn.Font = Enum.Font.GothamBold
SendBtn.Parent = InputFrame

local SendCorner = Instance.new("UICorner")
SendCorner.CornerRadius = UDim.new(0, 6)
SendCorner.Parent = SendBtn

---------------------------------------------------------
-- CHAT MESSAGE RENDERING ENGINE
---------------------------------------------------------
local function AddMessage(senderText, messageText, isAI)
    local Bubble = Instance.new("Frame")
    Bubble.BackgroundColor3 = isAI and THEME.AIBubble or THEME.UserBubble
    Bubble.BorderSizePixel = 0
    Bubble.Parent = ChatContainer

    local BubbleCorner = Instance.new("UICorner")
    BubbleCorner.CornerRadius = UDim.new(0, 8)
    BubbleCorner.Parent = Bubble

    local SenderLabel = Instance.new("TextLabel")
    SenderLabel.Size = UDim2.new(1, -16, 0, 14)
    SenderLabel.Position = UDim2.new(0, 8, 0, 4)
    SenderLabel.BackgroundTransparency = 1
    SenderLabel.Text = senderText
    SenderLabel.TextColor3 = isAI and THEME.Accent or THEME.TextMuted
    SenderLabel.TextSize = 10
    SenderLabel.Font = Enum.Font.GothamBold
    SenderLabel.TextXAlignment = Enum.TextXAlignment.Left
    SenderLabel.Parent = Bubble

    local MsgLabel = Instance.new("TextLabel")
    MsgLabel.Size = UDim2.new(1, -16, 0, 0)
    MsgLabel.Position = UDim2.new(0, 8, 0, 20)
    MsgLabel.BackgroundTransparency = 1
    MsgLabel.Text = messageText
    MsgLabel.TextColor3 = THEME.TextMain
    MsgLabel.TextSize = 11
    MsgLabel.Font = Enum.Font.Gotham
    MsgLabel.TextXAlignment = Enum.TextXAlignment.Left
    MsgLabel.TextWrapped = true
    MsgLabel.Parent = Bubble

    -- Dynamic Auto-Sizing
    local textBounds = game:GetService("TextService"):GetTextSize(
        messageText, 11, Enum.Font.Gotham, Vector2.new(380, 2000)
    )
    MsgLabel.Size = UDim2.new(1, -16, 0, textBounds.Y)
    Bubble.Size = UDim2.new(1, -6, 0, textBounds.Y + 28)

    ChatContainer.CanvasPosition = Vector2.new(0, ChatContainer.AbsoluteCanvasSize.Y)
end

---------------------------------------------------------
-- LOCAL AI ASSISTANT LOGIC
---------------------------------------------------------
local function ProcessAIResponse(query)
    local q = query:lower()
    
    if q:find("speed") or q:find("walkspeed") then
        local char = LocalPlayer.Character
        if char and char:FindFirstChild("Humanoid") then
            char.Humanoid.WalkSpeed = 32
            return "Applied speed boost! Your WalkSpeed is set to 32."
        end
        return "Could not adjust speed: Character humanoid not found."
    elseif q:find("jump") or q:find("jumppower") then
        local char = LocalPlayer.Character
        if char and char:FindFirstChild("Humanoid") then
            char.Humanoid.JumpPower = 100
            return "Applied jump boost! Your JumpPower is set to 100."
        end
        return "Could not adjust jump: Character humanoid not found."
    elseif q:find("reset") then
        local char = LocalPlayer.Character
        if char and char:FindFirstChild("Humanoid") then
            char.Humanoid.WalkSpeed = 16
            char.Humanoid.JumpPower = 50
            return "Reset speed and jump power to default values."
        end
    elseif q:find("hello") or q:find("hi") or q:find("hey") then
        return "Greetings! How can I assist you with your Roblox session today?"
    elseif q:find("help") or q:find("commands") then
        return "Here are commands I can execute:\n• 'speed' / 'walkspeed'\n• 'jump'\n• 'reset'"
    else
        return "I'm a local AI assistant. Type 'help' to see my available actions."
    end
end

local function SendMessage()
    local text = TextBox.Text
    if text:match("^%s*$") then return end

    AddMessage(LocalPlayer.Name, text, false)
    TextBox.Text = ""

    task.delay(0.3, function()
        local response = ProcessAIResponse(text)
        AddMessage("AI Assistant", response, true)
    end)
end

SendBtn.MouseButton1Click:Connect(SendMessage)
TextBox.FocusLost:Connect(function(enterPressed)
    if enterPressed then SendMessage() end
end)

---------------------------------------------------------
-- UI INTERACTIVITY & DRAGGING LOGIC
---------------------------------------------------------
-- Close Button
CloseBtn.MouseButton1Click:Connect(function()
    MainFrame.Visible = false
end)

CloseBtn.MouseEnter:Connect(function() CloseBtn.TextColor3 = Color3.fromRGB(240, 80, 80) end)
CloseBtn.MouseLeave:Connect(function() CloseBtn.TextColor3 = THEME.TextMuted end)

-- Minimize Button
local isMinimized = false
local defaultSize = MainFrame.Size

MinimizeBtn.MouseButton1Click:Connect(function()
    isMinimized = not isMinimized
    if isMinimized then
        ChatContainer.Visible = false
        InputFrame.Visible = false
        TweenService:Create(MainFrame, TweenInfo.new(0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {
            Size = UDim2.new(0, 480, 0, 40)
        }):Play()
        MinimizeBtn.Text = "+"
    else
        local tween = TweenService:Create(MainFrame, TweenInfo.new(0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {
            Size = defaultSize
        })
        tween:Play()
        tween.Completed:Connect(function()
            if not isMinimized then
                ChatContainer.Visible = true
                InputFrame.Visible = true
            end
        end)
        MinimizeBtn.Text = "—"
    end
end)

MinimizeBtn.MouseEnter:Connect(function() MinimizeBtn.TextColor3 = THEME.TextMain end)
MinimizeBtn.MouseLeave:Connect(function() MinimizeBtn.TextColor3 = THEME.TextMuted end)

-- Dragging Functionality
local dragging, dragInput, dragStart, startPos

Header.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = true
        dragStart = input.Position
        startPos = MainFrame.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 or input.UserInputType == Enum.UserInputType.Touch then
        dragInput = input
    end
end)

UserInputService.InputChanged:Connect(function(input)
    if input == dragInput and dragging then
        local delta = input.Position - dragStart
        TweenService:Create(MainFrame, TweenInfo.new(0.08, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {
            Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
        }):Play()
    end
end)

-- Initial Welcome Message
AddMessage("AI Assistant", "Welcome! I am your AI assistant. How can I help you today?", true)

Advertisements

Comments

1

Did it work for you? Sign in to share your experience.

Sign in to comment
eliyahm39Creatorabout 1 month ago

check out my new script its this one but better