How do I get mouse position from Local Script to Server Script? [ANSWERED]
Asked by
7 years ago Edited 7 years ago
I'm trying to make when ever I press 'F' , there will be a brick spawned to the mouse position (vector 3)
Using Local Script , I created this
01 | local Player = game.Players.LocalPlayer |
02 | local Mouse = Player:GetMouse() |
04 | Mouse.KeyDown:connect( function (key) |
07 | local Part = Instance.new( "Part" ,game.Workspace) |
08 | Part.Position = Mouse.Hit.p |
it works absolutely perfect.
Here's the problem , I want my game to be Filter Enabled.
So now, when I press 'F' , the part would be created in workspace but not at my mouse position.
I tried using the 'RemoteEvent' and 'RemoteFunction'.
But it wouldn't work :(
How do I get a 'Vector 3' value to my Server script?