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)