I have a jetpack tool that works perfectly fine on pc however not on mobile. When you tap/hold with it equipped on mobile it prints the numbers but it does nothing.
local tool = script.Parent
local UserInputService = game:GetService("UserInputService")
local function a()
print("test3")
script.Parent.Handle.WEEE.MaxForce = Vector3.new(0,math.huge,0)
tool.tube.Attachment.Fire.Enabled = true
tool.tube2.Attachment.Fire.Enabled = true
tool.Handle.Swoosh:Play()
tool.Parent.Humanoid.WalkSpeed = 80
end
local function b()
print("test4")
script.Parent.Handle.WEEE.MaxForce = Vector3.new(0,0,0)
tool.tube.Attachment.Fire.Enabled = false
tool.tube2.Attachment.Fire.Enabled = false
tool.Handle.Swoosh:Stop()
tool.Parent.Humanoid.WalkSpeed = 16
end
tool.Activated:Connect(a, print("test"))
tool.Deactivated:Connect(b, print("test2"))
i found the issue, it was that on mobile tool.Activated only works when you instantly tap and release the button (and arent swiping obviously), so does the tool.Deactivated. so i just made 2 remote events and 2 scripts (1 local and one server) and it worked
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:Connect(function()
if script.Parent.Parent == game.Players.LocalPlayer.Character then
script.Parent.RemoteEvent:FireServer()
end
end)
mouse.Button1Up:Connect(function()
if script.Parent.Parent == game.Players.LocalPlayer.Character then
script.Parent.unwork:FireServer()
end
end)