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

Attempt to index local "mouse" (a nil value) Anyone have any ideas?

Asked by 7 years ago

Help someone. Filtering is enabled and I've tried to pass on the mouse from the local script but it just isn't working. Anyone have any ideas because I'm desperate.

01-- Local Script
02 
03Player = game.Players.LocalPlayer
04mouse = Player:GetMouse()
05 
06 
07anim = game.ReplicatedStorage.Caught
08 
09script.Parent.Equipped:connect(function()
10    mouse.Button1Down:connect(function()
11 
12    script.Parent.RemoteEvent:FireServer(mouse,anim)
13    end)
14end)
15 
View all 46 lines...
0
On the player variable add, or game.Players.PlayerAdded:Wait() saSlol2436 716 — 7y
0
Plus connect is depricated, use Connect saSlol2436 716 — 7y
0
does not matter. outlook1234567890 115 — 7y
0
I fixed it anyway, thank you ThePhantomG 30 — 7y

1 answer

Log in to vote
1
Answered by
DanzLua 2879 Moderation Voter Community Moderator
7 years ago
Edited 7 years ago

Here's the thing, you cannot send the mouse over as an argument to be read by the server, you will have to send individual stuff over, so if you want to get the mouse.Target over you will have to send that over instead of the entire mouse.

1FireServer(mouse.Target,anim)
2 
3script.Parent.RemoteEvent.OnServerEvent:connect(function(Player,target,anim)
Ad

Answer this question