Jetpack tool not working on mobile

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"))

what did u say was it something wrong

Is there more code here? Cant really get much out of this snippet alone (cause this seems like it should work)

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)
local tool = script.Parent

script.Parent.RemoteEvent.OnServerEvent:Connect(function()
	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)

script.Parent.unwork.OnServerEvent:Connect(function()
	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)
1 Like

Nope, I just thought my idea wouldn’t work.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.