Quite easy to port to mobile devices.
local tweens = game:GetService("TweenService")
local userInput = game:GetService("UserInputService")
local players = game:GetService("Players")
local player = players.LocalPlayer
local clickFrame = script:WaitForChild("ClickFrame")
local screenGui = script.Parent
local _tweens = table.create(8)
local debounce = false
local function onInputBegan(inputObject, gameProcessed)
if inputObject.UserInputType.Name ~= "MouseButton1" and inputObject.UserInputType.Name ~= "Touch" then return end
if gameProcessed then return end
if debounce then return end
debounce = true
local clickFrameClone = clickFrame:Clone()
clickFrameClone.Position = UDim2.new(0, inputObject.Position.X, 0, inputObject.Position.Y)
clickFrameClone.Parent = screenGui
table.insert(_tweens, tweens:Create(clickFrameClone.Down, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = UDim2.new(0.5, 0, 0.8, 0)}))
table.insert(_tweens, tweens:Create(clickFrameClone.DownLeft, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = UDim2.new(0.2, 0, 0.8, 0)}))
table.insert(_tweens, tweens:Create(clickFrameClone.DownRight, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = UDim2.new(0.8, 0, 0.8, 0)}))
table.insert(_tweens, tweens:Create(clickFrameClone.Left, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = UDim2.new(0.2, 0, 0.5, 0)}))
table.insert(_tweens, tweens:Create(clickFrameClone.Right, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = UDim2.new(0.8, 0, 0.5, 0)}))
table.insert(_tweens, tweens:Create(clickFrameClone.Up, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = UDim2.new(0.5, 0, 0.2, 0)}))
table.insert(_tweens, tweens:Create(clickFrameClone.UpLeft, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = UDim2.new(0.2, 0, 0.2, 0)}))
table.insert(_tweens, tweens:Create(clickFrameClone.UpRight, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = UDim2.new(0.8, 0, 0.2, 0)}))
for _, tween in ipairs(_tweens) do
tween:Play()
end
table.clear(_tweens)
task.wait(0.5)
clickFrameClone:Destroy()
debounce = false
end
userInput.InputBegan:Connect(onInputBegan)
test.rbxl (34.1 KB)
https://gyazo.com/c4f07527efa396cb320c61883fdc7026