Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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().

3 comments

0

lemme try it

0

how to do Remote Events

0

Try this tutorial from alvinBlox to help you learn remote events. https://www.youtube.com/watch?v=wCr5VXJ34T4

This discussion is preserved as it was. New answers, comments, and votes are closed.