
Key RequiredUniversal

--[[
Mobile Super Fling Script
Creates a button to activate super fling when holding objects
]]
--//Strength Settings\\--
local StrengthMultiplier = 450 -- Much higher will just set players back, not props though.
--\\End//--
--//Vars\\--
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")
local Debris = game:GetService("Debris")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local gui = player:WaitForChild("PlayerGui")
--\\End//--
--//Create Mobile Button\\--
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "SuperFlingUI"
screenGui.Parent = gui
local flingButton = Instance.new("TextButton")
flingButton.Name = "FlingButton"
flingButton.Text = "SUPER FLING"
flingButton.Size = UDim2.new(0.3, 0, 0.1, 0)
flingButton.Position = UDim2.new(0.7, 0, 0.8, 0)
flingButton.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
flingButton.TextColor3 = Color3.new(1, 1, 1)
flingButton.Font = Enum.Font.SourceSansBold
flingButton.TextScaled = true
flingButton.Parent = screenGui
local buttonActive = false
flingButton.MouseButton1Down:Connect(function()
buttonActive = true
end)
flingButton.MouseButton1Up:Connect(function()
buttonActive = false
end)
flingButton.TouchLongPress:Connect(function()
buttonActive = true
end)
flingButton.TouchEnded:Connect(function()
buttonActive = false
end)
--\\End//--
--//Fling Function\\--
Workspace.ChildAdded:Connect(function(NewModel)
if NewModel.Name == "GrabParts" then
local PartToImpulse = NewModel:FindFirstChild("GrabPart")
if PartToImpulse and PartToImpulse:FindFirstChild("WeldConstraint") then
PartToImpulse = PartToImpulse.WeldConstraint.Part1
if PartToImpulse then --//Part found
local VelocityObject = Instance.new("BodyVelocity", PartToImpulse)
NewModel:GetPropertyChangedSignal("Parent"):Connect(function()
if not NewModel.Parent then
if buttonActive then --//Button was pressed when released
VelocityObject.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
VelocityObject.Velocity = workspace.CurrentCamera.CFrame.lookVector * StrengthMultiplier
Debris:AddItem(VelocityObject, 1)
-- Make button flash to indicate fling
for i = 1, 2 do
flingButton.BackgroundColor3 = Color3.fromRGB(50, 255, 50)
task.wait(0.1)
flingButton.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
task.wait(0.1)
end
else
VelocityObject:Destroy() --//Cancel Launch
end
end
end)
end
end
end
end)
--\\End//--



doesn’t work for me