Categories > Coding > Lua >
Dragify Code (Smooth one)
Posted
local UIS = game:GetService("UserInputService") function dragify(Frame) dragToggle = nil local dragSpeed = 0 dragInput = nil dragStart = nil local dragPos = nil function updateInput(input) local Delta = input.Position - dragStart local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y) game:GetService("TweenService"):Create(Frame, TweenInfo.new(0.25), {Position = Position}):Play() end Frame.InputBegan:Connect(function(input) if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and UIS:GetFocusedTextBox() == nil then dragToggle = true dragStart = input.Position startPos = Frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragToggle = false end end) end end) Frame.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) game:GetService("UserInputService").InputChanged:Connect(function(input) if input == dragInput and dragToggle then updateInput(input) end end) end dragify(script.Parent)
Replied
any way to recreate that smoothness efx in c# wpf tho?
thats the real questuion
Cancel
Post
Replied
@MINISHXP ...That is a completely different question that cannot even be remotely related to how the lua one works
Cancel
Post
Replied
@63568The only related thing that i can think about them, is that they both where not built for security
yeah having to use an additional obfuscator on c# from vs sucks and i had to buy one
Cancel
Post
Replied
You skidded beta's code
Also use code blocks
local UIS = game:GetService("UserInputService")
function dragify(Frame)
dragToggle = nil
local dragSpeed = 0
dragInput = nil
dragStart = nil
local dragPos = nil
function updateInput(input)
local Delta = input.Position - dragStart
local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y) game:GetService("TweenService"):Create(Frame, TweenInfo.new(0.25), {Position = Position}):Play()
end
Frame.InputBegan:Connect(function(input)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and UIS:GetFocusedTextBox() == nil then dragToggle = true dragStart = input.Position startPos = Frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragToggle = false end end) end end) Frame.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) game:GetService("UserInputService").InputChanged:Connect(function(input) if input == dragInput and dragToggle then updateInput(input) end end) end dragify(script.Parent)
Cancel
Post
no
Error: The signature must be between 3-200 characters
Replied
:eyes:
i want some proof that this code is urs or i will make you kiss my dog's behind
Cancel
Post
JustMarie#0709
Â
JustMarie#0709
Â
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post