A Werid Tool error

Whenever I join the game it says on line 2 remote event is not a valid member of tool


Server Script:

local wand = game.StarterPack.Wand 
local RE = script.Parent.RemoteEvent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
wand.Activated:Connect(function()
	RE:FireServer(mouse.Hit.Position)
end)

local script
image

So uh

You’re getting the StarterPack, not the actual player’s Backpack

Just replace your wand variable with script.Parent, as the Script’s Parent would be referring to the Tool Object itself

Referencing it from the StarterPack would be from the server side

local wand = script.Parent
local RE = wand:WaitForChild("RemoteEvent")

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

wand.Activated:Connect(function()
	RE:FireServer(mouse.Hit.Position)
end)


this the error it gave me even after I changed it

I’d just probably reference the RemoteEvent inside ReplicatedStorage then, it shouldn’t result in that error if it’s parented inside the Tool but you can give it a shot (May be due to replication issues)

local wand = script.Parent
local RE = game.ReplicatedStorage:WaitForChild("RemoteEvent")

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

wand.Activated:Connect(function()
	RE:FireServer(mouse.Hit.Position)
end)

Also make sure that you are putting the LocalScript inside the Tool