I am currently testing out the use of remote events inside tools.
I want to make the tool emit particles from a server script. I have it set up so that the local script detects the tool’s activation which then fires a remote event to the server script so the server script could enable the particle emitter.
The tool is inside the starter pack.
What is the Issue?
The issue is that the remote event won’t fire and the error, “RemoteEvent is not a valid member of Tool” keeps popping up when I run the game.
Here are my scripts:
Local Script:
local remoteEvent = script.Parent.RemoteEvent
local tool = script.Parent
tool.Activated:Connect(function()
remoteEvent:FireServer()
end)
Server Script:
local remoteEvent = script.Parent.RemoteEvent
local particleEmitter = script.Parent.Handle.ParticleEmitter
remoteEvent.OnServerEvent:Connect(function()
particleEmitter.Enabled = true
end)
Does anyone have a solution to this? What is the best way to incorporate remote events in tools? Is there any other way to communicate between server and local scripts in tools?
I want to know how to use Remote events with tools so don’t tell me to put the tool activated event in the server script and the enable particle emitter in the activated event.