
Key Required
Pullmod
Lua Script•163 lines (4771 chars)
-- Services
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
-- Configuration
local PULL_FORCE = 350
local PULL_KEY = Enum.KeyCode.K
local FIRE_INTERVAL = 0.15 -- Repeat speed while holding (in seconds)
local isHolding = false
local lastTriggerTime = 0
-- Create ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "PullMechanicGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = playerGui
-- Main Container Frame
local frame = Instance.new("Frame")
frame.Name = "MainFrame"
frame.Size = UDim2.new(0, 180, 0, 100)
frame.Position = UDim2.new(0.7, 0, 0.5, 0)
frame.BackgroundColor3 = Color3.fromRGB(20, 20, 24)
frame.BorderSizePixel = 0
frame.Active = true
frame.Parent = screenGui
local frameCorner = Instance.new("UICorner")
frameCorner.CornerRadius = UDim.new(0, 12)
frameCorner.Parent = frame
local frameStroke = Instance.new("UIStroke")
frameStroke.Color = Color3.fromRGB(45, 45, 55)
frameStroke.Thickness = 1.5
frameStroke.Parent = frame
-- Title Bar / Handle
local title = Instance.new("TextLabel")
title.Name = "Title"
title.Size = UDim2.new(1, 0, 0, 28)
title.Position = UDim2.new(0, 0, 0, 2)
title.BackgroundTransparency = 1
title.Text = "PULL CONTROL"
title.TextColor3 = Color3.fromRGB(180, 180, 195)
title.TextSize = 11
title.Font = Enum.Font.GothamBold
title.Parent = frame
-- Touch/Click Button
local pullButton = Instance.new("TextButton")
pullButton.Name = "PullButton"
pullButton.Size = UDim2.new(0.86, 0, 0.52, 0)
pullButton.Position = UDim2.new(0.07, 0, 0.36, 0)
pullButton.BackgroundColor3 = Color3.fromRGB(0, 122, 255)
pullButton.Text = "HOLD PULL"
pullButton.TextColor3 = Color3.fromRGB(255, 255, 255)
pullButton.TextSize = 14
pullButton.Font = Enum.Font.GothamBold
pullButton.Parent = frame
local buttonCorner = Instance.new("UICorner")
buttonCorner.CornerRadius = UDim.new(0, 8)
buttonCorner.Parent = pullButton
--------------------------------------------------------------------------------
-- DRAGGABLE UI LOGIC (Supports Touch & Mouse)
--------------------------------------------------------------------------------
local dragging = false
local dragInput, dragStart, startPos
local function updateInput(input)
local delta = input.Position - dragStart
frame.Position = UDim2.new(
startPos.X.Scale,
startPos.X.Offset + delta.X,
startPos.Y.Scale,
startPos.Y.Offset + delta.Y
)
end
frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
frame.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
updateInput(input)
end
end)
--------------------------------------------------------------------------------
-- PULL MECHANIC LOGIC
--------------------------------------------------------------------------------
local function triggerPull()
local character = player.Character
if not character then return end
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
local lookDirection = workspace.CurrentCamera.CFrame.LookVector
humanoidRootPart.AssemblyLinearVelocity = lookDirection * PULL_FORCE
end
end
-- Continuous Loop while holding down
RunService.Heartbeat:Connect(function()
if isHolding then
local currentTime = tick()
if currentTime - lastTriggerTime >= FIRE_INTERVAL then
lastTriggerTime = currentTime
triggerPull()
end
end
end)
-- Touch & Mouse Hold Triggers
pullButton.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
isHolding = true
lastTriggerTime = 0
end
end)
pullButton.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
isHolding = false
end
end)
-- Keyboard Support [K]
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent and input.KeyCode == PULL_KEY then
isHolding = true
lastTriggerTime = 0
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == PULL_KEY then
isHolding = false
end
end)Features & Information
Pullmod
Community Comments (0)
No comments yet for this script.
