01 | local p = game.Players.LocalPlayer |
02 | local m = p:GetMouse() |
03 | local t = script.Parent |
04 | local r = script.Parent.RemoteEvent |
05 |
06 | local function a () |
07 | local t = m.Target |
08 | r:FireServer(t) |
09 | end |
10 |
11 | t.Activated:Connect(a) |
Error on line 4, Client/Server side shows the RemoteEvent inside the tool.
EDIT :
It’s a LocalScript… obviously and it is inside the tool… obviously.
It’s probably not existed at that time so do
1 | local r = script.Parent:WaitForChild( "RemoteEvent" ) |