Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

TouchSwipe problem, anyone figure this out?

Asked by 9 years ago

Everything in this is a GUI Frame. It's active is set to true, please help! I think the issue is primarily the direction. I haven't quite figured out the Enum. Here's where I got my information for the TouchSwipe: http://wiki.roblox.com/index.php?title=API:Class/UserInputService/TouchSwipe

function openside()
if on == false then
on = true
Background:TweenPosition(UDim2.new(0.5, 0, 0, 0))
MenuSelection:TweenPosition(UDim2.new(0,0,0,0))
repeat wait() until MenuSelection.Position == UDim2.new(0,0,0,0) and Background.Position == UDim2.new(0.5, 0,0,0)
on = false
end
end

function closeside()
if on == false then
on = true
Background:TweenPosition(UDim2.new(0, 0, 0, 0))
MenuSelection:TweenPosition(UDim2.new(-0.5,0,0,0))
repeat wait() until MenuSelection.Position == UDim2.new(-.5,0,0,0) and Background.Position == UDim2.new(0, 0,0,0)
on = false
end
end

MainBackground.TouchSwipe:connect(function(dir)
if dir == 0 then
openside()
elseif dir == 1 then
closeside()
end
end)

Answer this question