I'm trying to make this Pen model: http://www.roblox.com/Pen-item?id=270659368 work for tablet users. Here is a link to the previous thread: https://scriptinghelpers.org/questions/19920/how-would-i-make-the-following-pen-tool-work-for-tablet-users
--Use the UserInputService to see if the software is touchscreen, next get the mouse and sees when he clicks, when that happens just use mouse.hit.p to find the cframe the mouse is at.
local userinputservice = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local on = false
local pen = player.Character.Pen --The pen
function touchscreen()
return userinputservice.TouchEnabled
end
mouse.Button1Down:connect(function()
on = true
while on wait() do
pen.Center.CFrame = mouse.hit.p --Replace Center with the part you want to be over the mouse.
end
end)
mouse.Button1Up:connect(function()
on = false
end)
