Issue with firing remote event

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want to fire a remote event that causes an npc to move torwards the player.

  1. What is the issue? Include screenshots / videos if possible!

The remote event is being fired by the client, but is not being recieved by the script.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I tried moving it to different locations such as: Replicated First, Replicated Storare, Server Storage, and Server Script Service, but nothing seemed to work.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Local Script

local player = game.Players.LocalPlayer
local char = player.Character
script.Parent.MouseButton1Click:Connect(function()
	game.Workspace.Camera.CameraSubject = game.Workspace.Dummy.Humanoid
	wait(5)
	game.ReplicatedStorage.Transfer:FireServer(player, char)
	local ss = game.SoundService
	local sound = ss.chase
	sound:Play()
	
end)

Server Script

script.Parent.OnServerEvent:Connect(function(player, char)
	char.Head.Face.Texture = "rbxassetid://2541148009"
	local newchar = player.Character
	local humroot = newchar.HumanoidRootPart.Position
	while true do
		wait()
		char.Humanoid:MoveTo(humroot)
	end
end)

If you were wondering, i change the player’s character to an npc, and make the old character chase the npc.

Here is an image of the directory:
Remote Event;
image

Local Script;
image

Dummy;
image

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Scripts will not run in ReplicatedStorage. Try putting the script in ServerScriptService.

1 Like

It didn’t work for some reason, it said it didn’t exist?
image

Keep the remote event in replicated storage, and only move the server script. You’ll have to edit the sever script

1 Like

It worked! Thank you!
I will mark your post as solution!