- 4
- 2
написал хуету на рб мб кому то надо, идея была сделать чет по типу рванки но я зеленый в кодинге так что рванки в привычном виде не будет, мб потом, как пользоваться показал тут
кейстроуки сделанные на коленке для видоса:
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local CONFIG = {
FADE_TIME = 0.15,
KEY_COLORS = {
NORMAL = Color3.fromRGB(30, 30, 30),
PRESSED = Color3.fromRGB(255, 0, 255),
TEXT_NORMAL = Color3.fromRGB(255, 255, 255),
TEXT_PRESSED = Color3.fromRGB(255, 255, 255)
},
TRANSPARENCY = {
NORMAL = 0.1,
PRESSED = 0
},
LAYOUT = {
BUTTON_SIZE = UDim2.new(0, 40, 0, 40),
BUTTON_PADDING = UDim.new(0, 5),
CORNER_RADIUS = UDim.new(0, 8)
}
}
local keystrokesGui = Instance.new("ScreenGui")
keystrokesGui.Name = "KeystrokesDisplay"
keystrokesGui.ResetOnSpawn = false
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 200, 0, 300)
mainFrame.Position = UDim2.new(0.85, 0, 0.5, -150)
mainFrame.BackgroundTransparency = 1
mainFrame.Parent = keystrokesGui
local function createKeyButton(name, size)
local button = Instance.new("Frame")
button.Size = size or CONFIG.LAYOUT.BUTTON_SIZE
button.BackgroundColor3 = CONFIG.KEY_COLORS.NORMAL
button.BackgroundTransparency = CONFIG.TRANSPARENCY.NORMAL
button.Name = name
local corner = Instance.new("UICorner")
corner.CornerRadius = CONFIG.LAYOUT.CORNER_RADIUS
corner.Parent = button
local label = Instance.new("TextLabel")
label.Size = UDim2.new(1, 0, 1, 0)
label.BackgroundTransparency = 1
label.Text = name
label.TextColor3 = CONFIG.KEY_COLORS.TEXT_NORMAL
label.Font = Enum.Font.GothamBold
label.TextSize = 14
label.Parent = button
local glow = Instance.new("ImageLabel")
glow.Size = UDim2.new(1, 20, 1, 20)
glow.Position = UDim2.new(0, -10, 0, -10)
glow.BackgroundTransparency = 1
glow.Image = "rbxassetid://7331079227" -- Glow image
glow.ImageColor3 = CONFIG.KEY_COLORS.PRESSED
glow.ImageTransparency = 1
glow.Parent = button
return button
end
local wasdFrame = Instance.new("Frame")
wasdFrame.Size = UDim2.new(0, 130, 0, 130)
wasdFrame.Position = UDim2.new(0.5, -65, 0, 0)
wasdFrame.BackgroundTransparency = 1
wasdFrame.Parent = mainFrame
local W = createKeyButton("W")
W.Position = UDim2.new(0.5, -20, 0, 0)
W.Parent = wasdFrame
local A = createKeyButton("A")
A.Position = UDim2.new(0, 0, 0.5, -20)
A.Parent = wasdFrame
local S = createKeyButton("S")
S.Position = UDim2.new(0.5, -20, 0.5, -20)
S.Parent = wasdFrame
local D = createKeyButton("D")
D.Position = UDim2.new(1, -40, 0.5, -20)
D.Parent = wasdFrame
local spaceBar = createKeyButton("SPACE", UDim2.new(0, 120, 0, 30))
spaceBar.Position = UDim2.new(0.5, -60, 1, -40)
spaceBar.Parent = mainFrame
local otherKeysFrame = Instance.new("Frame")
otherKeysFrame.Size = UDim2.new(0, 130, 0, 90)
otherKeysFrame.Position = UDim2.new(0.5, -65, 0, 140)
otherKeysFrame.BackgroundTransparency = 1
otherKeysFrame.Parent = mainFrame
local commonKeys = {"E", "F", "G", "H", "X", "ALT"}
local keyPositions = {
E = UDim2.new(0, 0, 0, 0),
F = UDim2.new(0.5, -20, 0, 0),
G = UDim2.new(1, -40, 0, 0),
H = UDim2.new(0, 0, 1, -40),
X = UDim2.new(0.5, -20, 1, -40),
ALT = UDim2.new(1, -40, 1, -40)
}
for _, keyName in ipairs(commonKeys) do
local key = createKeyButton(keyName)
key.Position = keyPositions[keyName]
key.Parent = otherKeysFrame
end
local function animateKeyPress(keyFrame, pressed)
local targetColor = pressed and CONFIG.KEY_COLORS.PRESSED or CONFIG.KEY_COLORS.NORMAL
local targetTransparency = pressed and CONFIG.TRANSPARENCY.PRESSED or CONFIG.TRANSPARENCY.NORMAL
game:GetService("TweenService"):Create(keyFrame,
TweenInfo.new(CONFIG.FADE_TIME, Enum.EasingStyle.Quad),
{BackgroundColor3 = targetColor, BackgroundTransparency = targetTransparency}
):Play()
local glow = keyFrame:FindFirstChild("ImageLabel")
if glow then
game:GetService("TweenService"):Create(glow,
TweenInfo.new(CONFIG.FADE_TIME, Enum.EasingStyle.Quad),
{ImageTransparency = pressed and 0.7 or 1}
):Play()
end
end
local keyMap = {
[Enum.KeyCode.W] = W,
[Enum.KeyCode.A] = A,
[Enum.KeyCode.S] = S,
[Enum.KeyCode.D] = D,
[Enum.KeyCode.Space] = spaceBar,
[Enum.KeyCode.E] = otherKeysFrame.E,
[Enum.KeyCode.F] = otherKeysFrame.F,
[Enum.KeyCode.G] = otherKeysFrame.G,
[Enum.KeyCode.H] = otherKeysFrame.H,
[Enum.KeyCode.X] = otherKeysFrame.X,
[Enum.KeyCode.LeftAlt] = otherKeysFrame.ALT
}
UserInputService.InputBegan:Connect(function(input, gameProcessed)
local keyFrame = keyMap[input.KeyCode]
if keyFrame then
animateKeyPress(keyFrame, true)
end
end)
UserInputService.InputEnded:Connect(function(input)
local keyFrame = keyMap[input.KeyCode]
if keyFrame then
animateKeyPress(keyFrame, false)
end
end)
local dragging = false
local dragStart, startPos
mainFrame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = mainFrame.Position
end
end)
mainFrame.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = false
end
end)
UserInputService.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
local delta = input.Position - dragStart
mainFrame.Position = UDim2.new(
startPos.X.Scale,
startPos.X.Offset + delta.X,
startPos.Y.Scale,
startPos.Y.Offset + delta.Y
)
end
end)
keystrokesGui.Parent = game:GetService("CoreGui")
псевдо рванка не закрепленными обьектами:
local Players = game:GetService("Players")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local LocalPlayer = Players.LocalPlayer
local selectedPartsGroup = {}
local isFlingActive = false
local flingPower = 10000
local flingTarget = nil
local previewPart = nil
local bodyPositions = {}
local isMultiSelect = false
local flingRadius = 50
local function createPreviewPart()
local part = Instance.new("Part")
part.Size = Vector3.new(2, 2, 2)
part.Anchored = true
part.CanCollide = false
part.Transparency = 0.5
part.BrickColor = BrickColor.new("Really blue")
part.Material = Enum.Material.Neon
part.Parent = workspace
return part
local function createGui()
local ControlGui = Instance.new("ScreenGui")
ControlGui.Name = "PartController"
ControlGui.ResetOnSpawn = false
local MainFrame = Instance.new("Frame")
MainFrame.Size = UDim2.new(0, 200, 0, 300)
MainFrame.Position = UDim2.new(0.5, -100, 0.5, -150)
MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
MainFrame.BorderSizePixel = 0
MainFrame.Parent = ControlGui
local dragging = false
local dragInput, dragStart, startPos
local function update(input)
local delta = input.Position - dragStart
MainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
MainFrame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 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)
MainFrame.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
update(input)
end
end)
local StatusLabel = Instance.new("TextLabel")
StatusLabel.Size = UDim2.new(1, -20, 0, 25)
StatusLabel.Position = UDim2.new(0, 10, 0, 70)
StatusLabel.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
StatusLabel.BorderSizePixel = 0
StatusLabel.Text = "No part selected"
StatusLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
StatusLabel.TextSize = 12
StatusLabel.Font = Enum.Font.GothamSemibold
StatusLabel.Parent = MainFrame
local KeybindsLabel = Instance.new("TextLabel")
KeybindsLabel.Size = UDim2.new(1, -20, 0, 100)
KeybindsLabel.Position = UDim2.new(0, 10, 0, 100)
KeybindsLabel.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
KeybindsLabel.BorderSizePixel = 0
KeybindsLabel.Text = "Keybinds:\nE - берет обьект в курсоре\nF - телепортирует обьекты в игрока\nX - очистить выбор\nHold Alt - мульти выбор"
KeybindsLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
KeybindsLabel.TextSize = 12
KeybindsLabel.Font = Enum.Font.GothamSemibold
KeybindsLabel.TextWrapped = true
KeybindsLabel.Parent = MainFrame
return ControlGui, StatusLabel, MainFrame
end
-- Helper Functions
local function getAllConnectedParts(part)
local parts = {}
local checked = {}
local function scanPart(p)
if not checked[p] and not p.Anchored then
checked[p] = true
parts[p] = true
for _, touchingPart in pairs(p:GetTouchingParts()) do
if not touchingPart.Anchored then
scanPart(touchingPart)
end
end
for _, joint in pairs(p:GetJoints()) do
if joint.Part0 and not joint.Part0.Anchored then scanPart(joint.Part0) end
if joint.Part1 and not joint.Part1.Anchored then scanPart(joint.Part1) end
end
end
end
scanPart(part)
return parts
end
-- Corrected fling mechanics
local function updateFling()
if not isFlingActive then return end
local targetRoot = nil
for _, player in pairs(Players:GetPlayers()) do
if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
local distance = (player.Character.HumanoidRootPart.Position - LocalPlayer.Character.HumanoidRootPart.Position).magnitude
if distance <= flingRadius then
targetRoot = player.Character.HumanoidRootPart
break
end
end
end
if not targetRoot then
isFlingActive = false
return
end
for part, _ in pairs(selectedPartsGroup) do
if part and part.Parent then
-- Rapidly teleport to target and apply velocity
part.CFrame = targetRoot.CFrame
part.Velocity = Vector3.new(
math.random(-flingPower, flingPower),
math.random(-flingPower, flingPower),
math.random(-flingPower, flingPower)
)
part.RotVelocity = Vector3.new(
math.random(-400, 400),
math.random(-400, 400),
math.random(-400, 400)
)
end
end
end
-- Teleport logic
local function teleportPartsToSky()
if not next(selectedPartsGroup) then return end
for part, _ in pairs(selectedPartsGroup) do
local storedData = {
part = part,
originalCFrame = part.CFrame
}
table.insert(storedParts, storedData)
-- Create BodyPosition to maintain server authority
local bp = Instance.new("BodyPosition")
bp.Position = Vector3.new(part.Position.X, STORAGE_HEIGHT + (storageIndex * 10), part.Position.Z)
bp.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bp.P = 1000000
bp.Parent = part
bodyPositions[part] = bp
-- Freeze the part
part.Anchored = true
end
storageIndex = storageIndex + 1
end
local function returnPartsToPlayer()
if not next(storedParts) then return end
local playerPosition = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") and LocalPlayer.Character.HumanoidRootPart.Position
if not playerPosition then return end
for _, data in ipairs(storedParts) do
if data.part and data.part.Parent then
local bp = bodyPositions[data.part]
if bp then
bp.Position = playerPosition
end
-- Unfreeze the part
data.part.Anchored = false
end
end
end
-- Main Tool Functions
local function setupTool()
local ControlGui, StatusLabel, MainFrame = createGui()
previewPart = createPreviewPart()
previewPart.Transparency = 1
-- Clear selection function
local function clearPartsGroup()
isFlingActive = false
isTeleportActive = false
flingTarget = nil
for part, _ in pairs(selectedPartsGroup) do
local highlight = part:FindFirstChild("Highlight")
if highlight then highlight:Destroy() end
local bp = bodyPositions[part]
if bp then bp:Destroy() end
end
selectedPartsGroup = {}
bodyPositions = {}
StatusLabel.Text = "No parts selected"
end
-- Select parts function
local function selectPartsGroup(mainPart)
if not mainPart or mainPart.Anchored then return end
if not isMultiSelect then
clearPartsGroup()
end
local partsToSelect = getAllConnectedParts(mainPart)
for part, _ in pairs(partsToSelect) do
if not selectedPartsGroup[part] then
selectedPartsGroup[part] = true
local highlight = Instance.new("Highlight")
highlight.FillColor = Color3.fromRGB(255, 0, 255)
highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
highlight.FillTransparency = 0.5
highlight.Parent = part
end
end
StatusLabel.Text = "Parts group selected"
end
-- Keyboard controls
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.E then
local mouse = LocalPlayer:GetMouse()
if mouse.Target then
selectPartsGroup(mouse.Target)
end
elseif input.KeyCode == Enum.KeyCode.F then
isFlingActive = not isFlingActive
StatusLabel.Text = isFlingActive and "Flinging active" or "Fling stopped"
elseif input.KeyCode == Enum.KeyCode.X then
clearPartsGroup()
elseif input.KeyCode == Enum.KeyCode.LeftAlt then
isMultiSelect = true
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftAlt then
isMultiSelect = false
end
end)
RunService.Heartbeat:Connect(function()
if isFlingActive then
updateFling()
end
end)
ControlGui.Parent = game:GetService("CoreGui")
ControlGui.Enabled = true
end
setupTool()
--бля
еще одна псевдо рванка но вместо телепорта обьектов к игроку вращает их вокруг игрока (но не выкидывает а только толкает так как мне лень дописывать код):
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local LocalPlayer = Players.LocalPlayer
local CONFIG = {
HIGHLIGHT_COLORS = {
SELECTED = Color3.fromRGB(255, 0, 255),
ACTIVE = Color3.fromRGB(0, 255, 0)
},
ORBIT_SETTINGS = {
HEIGHT = 0,
RADIUS = 5,
SPEED = 2
},
PHASE_DISTANCE = 2,
NOCLIP_CHECK_DISTANCE = 10,
STORAGE_HEIGHT = 10000
}
local selectedParts = {}
local originalCFrames = {}
local isSticking = false
local isMultiSelect = false
local isFlying = false
local currentMode = "stick"
local flyVelocity = Vector3.new()
local function createSettingRow(parent, labelText, defaultValue, callback)
local container = Instance.new("Frame")
container.Size = UDim2.new(1, 0, 0, 30)
container.BackgroundTransparency = 1
container.Parent = parent
local label = Instance.new("TextLabel")
label.Size = UDim2.new(0.5, -5, 1, 0)
label.Position = UDim2.new(0, 5, 0, 0)
label.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
label.Text = labelText
label.TextColor3 = Color3.fromRGB(255, 255, 255)
label.Font = Enum.Font.Gotham
label.TextSize = 12
label.Parent = container
local input = Instance.new("TextBox")
input.Size = UDim2.new(0.5, -10, 1, 0)
input.Position = UDim2.new(0.5, 5, 0, 0)
input.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
input.Text = tostring(defaultValue)
input.TextColor3 = Color3.fromRGB(255, 255, 255)
input.Font = Enum.Font.Gotham
input.TextSize = 12
input.Parent = container
input.FocusLost:Connect(function()
local num = tonumber(input.Text)
if num then
callback(num)
end
end)
return container
end
local function createGui()
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "иди нахуй"
screenGui.ResetOnSpawn = false
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 300, 0, 400)
mainFrame.Position = UDim2.new(0.5, -150, 0.5, -200)
mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
mainFrame.BorderSizePixel = 0
mainFrame.Parent = screenGui
local titleBar = Instance.new("TextLabel")
titleBar.Size = UDim2.new(1, 0, 0, 30)
titleBar.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
titleBar.Text = "иди нахуй"
titleBar.TextColor3 = Color3.fromRGB(255, 255, 255)
titleBar.Font = Enum.Font.GothamBold
titleBar.TextSize = 14
titleBar.Parent = mainFrame
local settingsFrame = Instance.new("ScrollingFrame")
settingsFrame.Size = UDim2.new(1, -10, 1, -40)
settingsFrame.Position = UDim2.new(0, 5, 0, 35)
settingsFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
settingsFrame.BorderSizePixel = 0
settingsFrame.ScrollBarThickness = 6
settingsFrame.Parent = mainFrame
-- Add settings
local yOffset = 5
local function addSetting(labelText, defaultValue, callback)
local row = createSettingRow(settingsFrame, labelText, defaultValue, callback)
row.Position = UDim2.new(0, 0, 0, yOffset)
yOffset = yOffset + 35
end
addSetting("Orbit Height", CONFIG.ORBIT_SETTINGS.HEIGHT, function(value)
CONFIG.ORBIT_SETTINGS.HEIGHT = value
end)
addSetting("Orbit Radius", CONFIG.ORBIT_SETTINGS.RADIUS, function(value)
CONFIG.ORBIT_SETTINGS.RADIUS = value
end)
addSetting("Orbit Speed", CONFIG.ORBIT_SETTINGS.SPEED, function(value)
CONFIG.ORBIT_SETTINGS.SPEED = value
end)
local modeButton = Instance.new("TextButton")
modeButton.Size = UDim2.new(1, -10, 0, 30)
modeButton.Position = UDim2.new(0, 5, 0, yOffset)
modeButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
modeButton.Text = "Mode: " .. currentMode
modeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
modeButton.Font = Enum.Font.Gotham
modeButton.TextSize = 14
modeButton.Parent = settingsFrame
modeButton.MouseButton1Click:Connect(function()
currentMode = currentMode == "stick" and "orbit" or "stick"
modeButton.Text = "Mode: " .. currentMode
end)
yOffset = yOffset + 35
settingsFrame.CanvasSize = UDim2.new(0, 0, 0, yOffset + 5)
local dragging = false
local dragInput, dragStart, startPos
local function update(input)
local delta = input.Position - dragStart
mainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
titleBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 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)
titleBar.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
update(input)
end
end)
return screenGui
end
local function selectPart(part)
if part and part:IsA("BasePart") and not part.Anchored then
if not isMultiSelect then
for _, p in pairs(selectedParts) do
local highlight = p:FindFirstChild("Highlight")
if highlight then highlight:Destroy() end
end
selectedParts = {}
originalCFrames = {}
end
if not selectedParts[part] then
selectedParts[part] = true
originalCFrames[part] = part.CFrame
local highlight = Instance.new("Highlight")
highlight.FillColor = CONFIG.HIGHLIGHT_COLORS.SELECTED
highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
highlight.FillTransparency = 0.5
highlight.Parent = part
part.CFrame = CFrame.new(part.Position.X, CONFIG.STORAGE_HEIGHT, part.Position.Z)
end
end
end
local function movePartWithPhasing(part, targetPos)
local origin = part.Position
local direction = (targetPos - origin)
local distance = direction.Magnitude
if distance < CONFIG.PHASE_DISTANCE then
part.CFrame = CFrame.new(targetPos)
return
end
local ray = Ray.new(origin, direction.Unit * CONFIG.NOCLIP_CHECK_DISTANCE)
local hit, hitPos = workspace:FindPartOnRay(ray, part)
if hit and hit.CanCollide then
-- Teleport in small increments to phase through
local increment = direction.Unit * CONFIG.PHASE_DISTANCE
part.CFrame = CFrame.new(origin + increment)
else
part.CFrame = CFrame.new(targetPos)
end
end
local function updateFlyMovement()
if not isFlying then return end
local camera = workspace.CurrentCamera
local lookVector = camera.CFrame.LookVector
local rightVector = camera.CFrame.RightVector
flyVelocity = Vector3.new()
if UserInputService:IsKeyDown(Enum.KeyCode.W) then
flyVelocity = flyVelocity + lookVector
end
if UserInputService:IsKeyDown(Enum.KeyCode.S) then
flyVelocity = flyVelocity - lookVector
end
if UserInputService:IsKeyDown(Enum.KeyCode.A) then
flyVelocity = flyVelocity - rightVector
end
if UserInputService:IsKeyDown(Enum.KeyCode.D) then
flyVelocity = flyVelocity + rightVector
end
if UserInputService:IsKeyDown(Enum.KeyCode.Space) then
flyVelocity = flyVelocity + Vector3.new(0, 1, 0)
end
if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then
flyVelocity = flyVelocity + Vector3.new(0, -1, 0)
end
if flyVelocity.Magnitude > 0 then
flyVelocity = flyVelocity.Unit * CONFIG.FLY_SPEED
end
for part, _ in pairs(selectedParts) do
local targetPos = part.Position + flyVelocity * RunService.Heartbeat:Wait()
movePartWithPhasing(part, targetPos)
end
end
local function stickPartToPlayer()
local character = LocalPlayer.Character
if not character or not character:FindFirstChild("HumanoidRootPart") then return end
for part, _ in pairs(selectedParts) do
if currentMode == "stick" then
-- Stick below player
local offset = CFrame.new(0, -3, 0)
part.CFrame = character.HumanoidRootPart.CFrame * offset
else
-- Orbit mode
local time = tick()
local angle = time * CONFIG.ORBIT_SETTINGS.SPEED
local offset = CFrame.new(
math.cos(angle) * CONFIG.ORBIT_SETTINGS.RADIUS,
CONFIG.ORBIT_SETTINGS.HEIGHT,
math.sin(angle) * CONFIG.ORBIT_SETTINGS.RADIUS
)
part.CFrame = character.HumanoidRootPart.CFrame * offset
end
end
end
local function unselectAllParts()
for part, _ in pairs(selectedParts) do
local highlight = part:FindFirstChild("Highlight")
if highlight then highlight:Destroy() end
end
selectedParts = {}
originalCFrames = {}
end
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.E then
local mouse = LocalPlayer:GetMouse()
if mouse.Target then
selectPart(mouse.Target)
end
elseif input.KeyCode == Enum.KeyCode.F then
isSticking = not isSticking
elseif input.KeyCode == Enum.KeyCode.H then
isFlying = true
elseif input.KeyCode == Enum.KeyCode.X then
unselectAllParts()
elseif input.KeyCode == Enum.KeyCode.M then
currentMode = currentMode == "stick" and "orbit" or "stick"
elseif input.KeyCode == Enum.KeyCode.LeftAlt then
isMultiSelect = true
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.H then
isFlying = false
-- Reset part velocities
for part, _ in pairs(selectedParts) do
part.Velocity = Vector3.new()
end
elseif input.KeyCode == Enum.KeyCode.LeftAlt then
isMultiSelect = false
end
end)
RunService.Heartbeat:Connect(function()
if isSticking then
stickPartToPlayer()
end
if isFlying then
updateFlyMovement()
end
end)
local gui = createGui()
gui.Parent = game:GetService("CoreGui")
--с*кс