FireClient somehow not working?

FireClient somehow does not work even though i did nothing wrong.

the print(“fired”) doesnt work, but the line: print(“1”) and print(“2”) works
Please help im really confused
Local Script:

local ClientModule = require(game.ReplicatedStorage.ClientModule)

local plr = game.Players.LocalPlayer
repeat task.wait() until plr.Character ~= nil

local chr = plr.Character
local plrgui = plr.PlayerGui
local currentcam = workspace.CurrentCamera

local CameraFolder = workspace:WaitForChild("Cutscene_Cameras")

game.ReplicatedStorage.ServerToClientModule.OnClientEvent:Connect(function(Type, obj, reset)
	print("fired")
	if Type == "SetCamera" then
		
		if reset == false then
			ClientModule.SetCamera(currentcam, obj)
		elseif reset == true then
			ClientModule.SetCamera(currentcam, nil)
		end
		
	elseif Type == "Sound_Client" then
		
		if reset == false then
			ClientModule.Sound_Client(obj, "play")
		elseif reset == true then
			ClientModule.Sound_Client(obj, "stop")
		end
		

	elseif Type == "Music_Client" then
			if reset == false then
			ClientModule.Music_Client(obj, "play")
		elseif reset == true then
			ClientModule.Music_Client(obj, "stop")
		end
		
	end
	
end)

Server Script:

local CameraFolder = workspace:WaitForChild("Cutscene_Cameras")


game.ReplicatedStorage.StartAdventure.OnServerEvent:Connect(function(plr)
	local DataFolder = plr.DataFolder
	local _file = DataFolder[plr.CurrentFile.Value]
	
	local _Status = _file._Status
	
	
	if plr:FindFirstChild("Adventure_Started") then return end
	local db = Instance.new("BoolValue", plr)
	db.Name = "Adventure_Started"
	task.wait(.5)
	
	if _Status.Value == "Empty" then
		print("empty!")
		local Intro_Cutscene = CameraFolder:WaitForChild("Intro_Cutscene")

		--	game.ReplicatedStorage.ServerToClientModule:FireClient(plr, "SetCamera", Intro_Cutscene, false)
		plr.Character:MoveTo(workspace.THIGNY.Head.Position)
     print("1")
		game.ReplicatedStorage.ServerToClientModule:FireClient(plr, "Music_Client", "003 Sunflower Town", false)
    print("2")

	else
		print("not empty")
	end
end)

Where is the LocalScript placed within the game? LocalScripts only work in specific containers, so it might be in a place where its code doesn’t run.

1 Like

Turns out i was just being stupid and it was placed on StarterPlayer. Thx so much for the help!!!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.