need help converting local to normal script
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local grabbedPart = nil
local originalCFrame = nil
local originalColor = nil
local hoverRangeLimit = 5
local smoothness = 0.2
local throwVelocity = 50 -- Adjust this value to control the throwing speed
local ui1 = game.StarterGui.GrabGui.Frame.Q
local ui2 = game.StarterGui.GrabGui.Frame.Rmb
local function popout()
ui1:TweenSize(UDim2.new(0, 200,0, 50), "InOut", "Back")
ui2:TweenSize(UDim2.new(0, 200,0, 50), "InOut", "Back")
end
local function popin()
ui1:TweenSize(UDim2.new(0, 0,0, 0), "InOut", "Back")
ui2:TweenSize(UDim2.new(0, 0,0, 0), "InOut", "Back")
end
local function onGrab()
if grabbedPart then
return
end
local target = mouse.Target
if target and target:IsA("BasePart") and not target:FindFirstAncestorWhichIsA("BodyMover") then
local folder = target:FindFirstAncestor("CanPickup")
if folder and folder:IsDescendantOf(workspace) then
originalCFrame = target.CFrame
grabbedPart = target
grabbedPart.Anchored = true
grabbedPart.Massless = true
grabbedPart.Transparency = 0.5
originalColor = grabbedPart.BrickColor
-- Disable collision with other parts
grabbedPart.CanCollide = false
popout()
end
end
end