local Players = game:GetService("Players")
local player = Players.LocalPlayer
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CarryEvents = ReplicatedStorage:FindFirstChild("CarryEvents")
local CarryResponse = CarryEvents:FindFirstChild("CarryResponse")
local CarryShowPrompt = CarryEvents:FindFirstChild("CarryShowPrompt")
local CarryPrompt = Instance.new("ScreenGui")
CarryPrompt.Name = "CarryPrompt"
CarryPrompt.ResetOnSpawn = false
CarryPrompt.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
local PromptFrame = Instance.new("Frame")
PromptFrame.Size = UDim2.new(0, 320, 0, 200)
PromptFrame.Position = UDim2.new(0.5, -160, 0.5, -100)
PromptFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
PromptFrame.BackgroundTransparency = 0.15
PromptFrame.Visible = false
PromptFrame.BorderSizePixel = 0
local UICorner = Instance.new("UICorner")
UICorner.CornerRadius = UDim.new(0, 12)
UICorner.Parent = PromptFrame
local UIStroke = Instance.new("UIStroke")
UIStroke.Color = Color3.fromRGB(80, 80, 80)
UIStroke.Thickness = 1
UIStroke.Parent = PromptFrame
local Header = Instance.new("Frame")
Header.Size = UDim2.new(1, 0, 0, 40)
Header.BackgroundColor3 = Color3.fromRGB(0, 120, 215)
Header.BorderSizePixel = 0
local HeaderCorner = Instance.new("UICorner")
HeaderCorner.CornerRadius = UDim.new(0, 12)
HeaderCorner.Parent = Header
local HeaderText = Instance.new("TextLabel")
HeaderText.Size = UDim2.new(1, 0, 1, 0)
HeaderText.Text = "CARRY REQUEST"
HeaderText.Font = Enum.Font.GothamBold
HeaderText.TextColor3 = Color3.fromRGB(255, 255, 255)
HeaderText.BackgroundTransparency = 1
HeaderText.TextSize = 16
local Message = Instance.new("TextLabel")
Message.Size = UDim2.new(1, -40, 0, 80)
Message.Position = UDim2.new(0, 20, 0, 50)
Message.Text = "Player ingin mengangkatmu. Terima?"
Message.Font = Enum.Font.GothamMedium
Message.TextColor3 = Color3.fromRGB(220, 220, 220)
Message.BackgroundTransparency = 1
Message.TextWrapped = true
Message.TextSize = 14
Message.TextXAlignment = Enum.TextXAlignment.Center
local ButtonsFrame = Instance.new("Frame")
ButtonsFrame.Size = UDim2.new(1, -40, 0, 40)
ButtonsFrame.Position = UDim2.new(0, 20, 0, 140)
ButtonsFrame.BackgroundTransparency = 1
local AcceptButton = Instance.new("TextButton")
AcceptButton.Size = UDim2.new(0.45, 0, 1, 0)
AcceptButton.Position = UDim2.new(0, 0, 0, 0)
AcceptButton.Text = "YA"
AcceptButton.Font = Enum.Font.GothamBold
AcceptButton.TextColor3 = Color3.fromRGB(255, 255, 255)
AcceptButton.TextSize = 14
AcceptButton.BackgroundColor3 = Color3.fromRGB(0, 180, 0)
AcceptButton.AutoButtonColor = true
local AcceptButtonCorner = Instance.new("UICorner")
AcceptButtonCorner.CornerRadius = UDim.new(0, 6)
AcceptButtonCorner.Parent = AcceptButton
local DeclineButton = Instance.new("TextButton")
DeclineButton.Size = UDim2.new(0.45, 0, 1, 0)
DeclineButton.Position = UDim2.new(0.55, 0, 0, 0)
DeclineButton.Text = "TIDAK"
DeclineButton.Font = Enum.Font.GothamBold
DeclineButton.TextColor3 = Color3.fromRGB(255, 255, 255)
DeclineButton.TextSize = 14
DeclineButton.BackgroundColor3 = Color3.fromRGB(180, 0, 0)
DeclineButton.AutoButtonColor = true
local DeclineButtonCorner = Instance.new("UICorner")
DeclineButtonCorner.CornerRadius = UDim.new(0, 6)
DeclineButtonCorner.Parent = DeclineButton
local CloseButton = Instance.new("ImageButton")
CloseButton.Size = UDim2.new(0, 24, 0, 24)
CloseButton.Position = UDim2.new(1, -30, 0, 8)
CloseButton.Image = "rbxassetid://3926305904"
CloseButton.ImageRectOffset = Vector2.new(284, 4)
CloseButton.ImageRectSize = Vector2.new(24, 24)
CloseButton.BackgroundTransparency = 1
HeaderText.Parent = Header
Header.Parent = PromptFrame
Message.Parent = PromptFrame
AcceptButton.Parent = ButtonsFrame
DeclineButton.Parent = ButtonsFrame
ButtonsFrame.Parent = PromptFrame
CloseButton.Parent = PromptFrame
PromptFrame.Parent = CarryPrompt
CarryPrompt.Parent = player:WaitForChild("PlayerGui")
local function setupButtonHover(button, hoverColor)
button.MouseEnter:Connect(function()
TweenService:Create(button, TweenInfo.new(0.1), {BackgroundColor3 =
hoverColor}):Play()
end)
button.MouseLeave:Connect(function()
local originalColor = button.BackgroundColor3
TweenService:Create(button, TweenInfo.new(0.1), {BackgroundColor3 =
originalColor}):Play()
end)
end
setupButtonHover(AcceptButton, Color3.fromRGB(0, 220, 0))
setupButtonHover(DeclineButton, Color3.fromRGB(220, 0, 0))
local function setupButtons(carrier)
AcceptButton.MouseButton1Click:Connect(function()
TweenService:Create(PromptFrame, TweenInfo.new(0.2), {Size =
UDim2.new(0, 0, 0, 0), Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
CarryResponse:FireServer(carrier, true)
PromptFrame.Visible = false
end)
DeclineButton.MouseButton1Click:Connect(function()
TweenService:Create(PromptFrame, TweenInfo.new(0.2), {Size =
UDim2.new(0, 0, 0, 0), Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
CarryResponse:FireServer(carrier, false)
PromptFrame.Visible = false
end)
CloseButton.MouseButton1Click:Connect(function()
TweenService:Create(PromptFrame, TweenInfo.new(0.2), {Size =
UDim2.new(0, 0, 0, 0), Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
CarryResponse:FireServer(carrier, false)
PromptFrame.Visible = false
end)
end
CarryShowPrompt.OnClientEvent:Connect(function(carrier)
PromptFrame.Visible = true
PromptFrame.Size = UDim2.new(0, 0, 0, 0)
PromptFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
Message.Text = carrier.Name .. " ingin mengangkatmu.\nTerima permintaan ini?"
TweenService:Create(PromptFrame, TweenInfo.new(0.3, Enum.EasingStyle.Back), {
Size = UDim2.new(0, 320, 0, 200),
Position = UDim2.new(0.5, -160, 0.5, -100)
}):Play()
setupButtons(carrier)
end)