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

I'm trying to make a drawing system, not with decals but with textlabels?

Asked by 4 years ago

So, I inserted a script into workspace and then inserted this (i know it's GetMouse)

wait(5)
game.Players.PlayerAdded:Connect(function(p)
p:GetMouse().Click:Connect(function()
    local GUI = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
    local Label = Instance.new("TextLabel", GUI)
    Label.Text = ""
    Label.Size = UDim2.new(0,20,0,20)
    Label.Position = game.Players.LocalPlayer:GetMouse().Position
end)
end)

im not a pro at getting the mouse and sensing the click. all i need is to get on how the mouse click and mouse position

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You're trying to use local player and getMouse inside a script. These have to be in local scripts in order to function. You'll want to utilize Remote Events and mouse.Hit.p, for what you're trying to accomplish.

For the player and the mouse I'd recommend setting up variables for them in the beginning.

Local plr = game:GetServive("Players").LocalPlayer
local mouse = plr:GetMouse()

Just so you don't have to keep running GetMouse().

0
lemme try it User#29913 36 — 4y
0
how to do Remote Events User#29913 36 — 4y
0
Try this tutorial from alvinBlox to help you learn remote events. https://www.youtube.com/watch?v=wCr5VXJ34T4 XxTrueDemonxX 362 — 4y
Ad

Answer this question