I try using this:
local p = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
local m = p:GetMouse()
I try using this:
local p = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
local m = p:GetMouse()
The best way to do that is to use a local script.
Have a local script in starter pack or starter Gui with the following code:
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
You can then use Mouse to get properties like Hit.
There are other ways to do this but this is one of the simpler ways.
I see. In the past, I've been able to actually use a localscript, then have it set an ObjectValue's value to the player's Mouse. For some reason, this no longer works.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
You can't GetMouse can ONLY be used in a local script.