Remote event not firing

So I have a remote event that when called it doesnt print anything, the script that calls the remote event prints before and after the remote event and it works fine, there is not any errors printing in output, so I have no idea what to do.

local BossWaitTime = 10
local CFs={
	['Test1']=CFrame.new(-195.214,168.766,252.828);
	['Test2']=CFrame.new(-97.31,210.964, 234.82);
	['Test3']=CFrame.new(-63.596, 54.509, -60.744);
}
game.ReplicatedStorage.Remotes:WaitForChild("InvitePeople").OnServerEvent:Connect(function(Player,BeingInviteTo)
	print("Hi! Welcome to the boss area. What will you be fighting today? "..BeingInviteTo.."? That cool! Hope you enjoy :)")
	wait(BossWaitTime)
	Player.Parent = workspace[BeingInviteTo..'Battle']
	Player.HumanoidRootPart.CFrame=CFs[BeingInviteTo]
end)
 ^ script that runs after the remote event is called
script.Parent.MouseButton1Click:Connect(function(h)
	print("So player pressed it")
	print(Player.Name)
	if Player.Battle.Value == "Test1" then
		print("Player is fighting test1")
		game.ReplicatedStorage.Remotes.InvitePeople:FireAllClients(Player.Character,Player.Battle.Value)
		print("YES")
			for i,v in pairs(game.Players:GetChildren()) do
				if v.leaderstats.Level.Value >= 5 then
				if v.Name ~=Player.Name then
					v.Battle.Value = 'Test1'
						InvitePeople:Clone().Parent = v.PlayerGui
						
				end
			end
			script.Parent.Parent.Parent:Destroy()
	    	end
       end
    end)
 ^script that fires the remote event

:FireAllClients() is recieved with .OnClientEvent as :FireClient(). To get .OnServerEvent to run, you will need to fire it to the server with :FireServer()

2 Likes

Ohhhh. Thank you so much. Ill try rescripting it then.

1 Like