Hey! I have recently been working with mobile interface but how do i check if the player is holding down the screen?
while UIS:IsKeyDown(Enum.KeyCode.E) do
UIS.InputBegan:connect(function(input,gameProcessed)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.E then
local Count = 0
local Goal = 20
while UIS:IsKeyDown(Enum.KeyCode.E) do
local Generator = FindClosetGenerator()
if Generator then
local Power = Generator.Base.Power
LastGenerator = Generator
if Count == Goal then
game.ReplicatedStorage.Generator:FireServer(Generator.Name)
Count = 0
else
Count = Count + 1
local num = (Count / 400 * Goal)
if Power then
Power.Enabled = true
Power.Power:TweenSize(UDim2.new(num, 0,1, 0))
end
end
else
Count = 0
end
wait(1)
end
end
elseif input.UserInputType == Enum.UserInputType.Touch then
print("Touch screen detected")
print"Touch"
end
end)