if UIS.TouchEnabled then
local dragging
local currentPercent
connect1 = GuiTransparencyMove.TouchPan:Connect(function(touchPositions, totalTranslation, velocity, state)
local maxSize = Frame_2.AbsoluteSize
print(maxSize)
if state == Enum.UserInputState.Begin and not dragging then
print(“2”)
dragging = true
currentPercent = GuiTransparencyBar.Size.X.Scale/Frame_2.Size.X.Scale
GuiTransparencyMove.ImageTransparency = .4
elseif state == Enum.UserInputState.Change then
local increase = totalTranslation.X/maxSize
print(increase)
local newSize = currentPercent*Frame_2.Size.X.Scale+increase
if newSize > Frame_2.Size.X.Scale then
newSize = 1
elseif newSize < 0 then
newSize = 0
end
currentPercent = newSize
GuiTransparencyBar.Size = UDim2.new(newSize,0,.12,0)
GuiTransparencyMove.Position = UDim2.new((newSize-.035+.33),0,.389,0)
elseif state == Enum.UserInputState.End and dragging then
dragging = false
GuiTransparencyMove.ImageTransparency = 0
PlayersShownTxt_2.Text = string.sub(tostring(currentPercent),1,4)
ChangeGuiTransparencyFunction(currentPercent)
ChangeGuiTransparency:FireServer(currentPercent)
end
end)
end
When I run this script, and then use the roblox studio emulator to move the button across the screen, it doesn’t fire any of the prints.
Does touchpan not happen in Studio, or am I just doing something wrong?