Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-4

So where would I put this code given to me? [closed]

Asked by
Jt93 0
9 years ago

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)

Closed as Too Broad by Spongocardo and Perci1

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?