how do i GET MOUSE from a local script if i am using a remote event i been trying
01 | local mouse = game.Players.LocalPlayer:GetMouse() |
02 | local on = true |
03 | local size = . 1 |
04 | local ammo = 6 |
05 | script.Parent.Activated:Connect( function () |
06 |
07 | script.Parent.make:FireServer() |
08 |
09 |
10 |
11 |
12 | end ) |
13 | script.Parent.Deactivated:Connect( function () |
14 |
15 | script.Parent.fire:FireServer() |
16 |
17 | end ) |
Hi. I wouldn't fire the mouse itself, I would fire a mouse Property, example: "mouse.hit"
Local:
01 | local mouse = game.Players.LocalPlayer:GetMouse() |
02 | local on = true |
03 | local size = . 1 |
04 | local ammo = 6 |
05 | script.Parent.Activated:Connect( function () |
06 |
07 | script.Parent.make:FireServer(mouse.Target) -- or any other mouse property you'd like to use such as hit, etc. |
08 |
09 |
10 |
11 |
12 | end ) |
13 | script.Parent.Deactivated:Connect( function () |
14 |
15 | script.Parent.fire:FireServer() |
16 |
17 | end ) |
Server:
1 | eventname.OnServerEvent:Connect( function (plr, mousetarget) --[[ remoteevents pass the player as the first parameter, and the second, and third, and in that order, respectively to the ones you defined on the localscript.]] -- |
2 |
3 | --your code here <3 |
4 | end ) |