You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make mobile support, and improve the remote function for better version. It has double tap, and click for devices and makes chat system message. -
What is the issue? Include screenshots / videos if possible!
It didn’t returned themouse.Target
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I did looked everywhere, but I can’t find anything.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local gotMouse = game.ReplicatedStorage:WaitForChild("Events"):WaitForChild("GotMouse")
local mouse = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local LastTouch = tick()
gotMouse.OnClientInvoke = function()
--[[
the system message worked
]]
local connection
connection = UserInputService.InputBegan:Connect(function(input, processed)
if processed then
return
end
if input.KeyCode == Enum.UserInputType.MouseButton1 then
connection:Disconnect()
return mouse.Target
elseif input.KeyCode == Enum.UserInputType.Touch then
local timeSinceLastTouch = tick() - LastTouch
if timeSinceLastTouch <= 0.25 then
connection:Disconnect()
return mouse.Target
end
LastTouch = tick() -- i forgot to add, so it doesn't mess it up.
end
end)
end)
Assistant doesn’t helped me well, because it can’t make connection looped. Also the server command run this if i say something, that needs a mouse target.