JustPaste
HomeCategoriesAboutDonateContactTerms of UsePrivacy Policy
JustPaste

Free online notepad — write and share instantly

Navigate

  • Home
  • Timeline
  • Categories

Info

  • About
  • Donate
  • Contact

Legal

  • Terms of Use
  • Privacy Policy

© 2026 JustPaste.app. All rights reserved.

Made with ♥ by JustPaste

Untitled Page | JustPaste.app
3 months ago0 views
👨‍💻Programming
-- DARK PURPLE TOUCH FLING GUI WITH ANIMATION
local Players = game:GetService("Players")
local player = Players.LocalPlayer

-- CONFIG
local ANIM_ID = "rbxassetid://70956004013506" -- PUT YOUR ANIMATION ID
local THEME_COLOR = Color3.fromRGB(45,0,75)

-- GUI
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "FlingGui"
ScreenGui.Parent = player:WaitForChild("PlayerGui")
ScreenGui.ResetOnSpawn = false

local MainFrame = Instance.new("Frame")
MainFrame.Size = UDim2.new(0,200,0,100)
MainFrame.Position = UDim2.new(0.5,-100,0.5,-50)
MainFrame.BackgroundColor3 = THEME_COLOR
MainFrame.BorderSizePixel = 2
MainFrame.Active = true
MainFrame.Draggable = true
MainFrame.Parent = ScreenGui

local ToggleButton = Instance.new("TextButton")
ToggleButton.Size = UDim2.new(0.8,0,0.4,0)
ToggleButton.Position = UDim2.new(0.1,0,0.3,0)
ToggleButton.BackgroundColor3 = Color3.fromRGB(80,0,120)
ToggleButton.Text = "Fling: OFF"
ToggleButton.TextColor3 = Color3.new(1,1,1)
ToggleButton.Font = Enum.Font.SourceSansBold
ToggleButton.TextSize = 20
ToggleButton.Parent = MainFrame

-- ANIMATION
local animation = Instance.new("Animation")
animation.AnimationId = ANIM_ID
local animTrack

local flinging = false
local touchConnection

-- FLING FUNCTION
local function setupTouchFling()
	local char = player.Character
	if not char then return end
	local hrp = char:WaitForChild("HumanoidRootPart")
	local hum = char:WaitForChild("Humanoid")

	if not animTrack then
		animTrack = hum:LoadAnimation(animation)
	end

	animTrack:Play()

	touchConnection = hrp.Touched:Connect(function(hit)
		if not flinging then return end

		local enemyChar = hit.Parent
		local enemyHum = enemyChar and enemyChar:FindFirstChildOfClass("Humanoid")

		if enemyHum and enemyChar ~= char then
			local enemyHRP = enemyChar:FindFirstChild("HumanoidRootPart")
			if enemyHRP then
				enemyHRP.Velocity = Vector3.new(0,150,0) + (hrp.CFrame.LookVector * 200)
			end
		end
	end)
end

-- BUTTON
ToggleButton.MouseButton1Click:Connect(function()
	flinging = not flinging

	if flinging then
		ToggleButton.Text = "Fling: ON"
		ToggleButton.BackgroundColor3 = Color3.fromRGB(150,0,255)
		setupTouchFling()
	else
		ToggleButton.Text = "Fling: OFF"
		ToggleButton.BackgroundColor3 = Color3.fromRGB(80,0,120)

		if animTrack then
			animTrack:Stop()
		end

		if touchConnection then
			touchConnection:Disconnect()
		end
	end
end)
← Back to timeline