Remote event not firing/working

Hello everyone. Got a problem. I have a remote event that simply doesn’t work. I don’t know the issue.
The remote event is in replicated storage, the sever script is in server script service, and the local script is in starter character scripts (I already tried it in starter player scripts, nothing). Here is my code:

Server:

local ts = game:GetService(“TeleportService”)

local windows = workspace.Windows:GetChildren()
local currentWindow

for i, v in pairs (windows) do
if v:FindFirstChild(“Face”) then
currentWindow = v
end
end

local face = currentWindow.Face

local lastChosen = {}
table.insert(lastChosen, currentWindow)

local event = game.ReplicatedStorage:WaitForChild(“Jumpscare”)
local timeEvent = game.ReplicatedStorage:WaitForChild(“UpdateTime”)
local event1 = game.ReplicatedStorage:WaitForChild(“6AM”)
local cutscene = game.ReplicatedStorage:WaitForChild(“Cutscene”)

local function random()

local newWindow = windows[math.random(1,#windows)]

if table.find(lastChosen,newWindow) then
	repeat
		
		task.wait()
		newWindow = windows[math.random(1,#windows)]
		
	until not table.find(lastChosen,newWindow)
	
end

table.clear(lastChosen)
table.insert(lastChosen, newWindow)

return newWindow

end

local counter = 0
local timer = 0

cutscene:FireAllClients()
print(“fired”)

cutscene.OnServerEvent:Wait()

Output: Fired

Client:

local ts = game.TweenService

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local cam = workspace.CurrentCamera

local event = game.ReplicatedStorage:WaitForChild(“Cutscene”)

event.OnClientEvent:Connect(function()

print("event")

local info = TweenInfo.new(
	
	1.5,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.In,
	0,
	true,
	0
	
)

local info1 = TweenInfo.new(

	.5,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.In,
	0,
	true,
	0

)

local tween = ts:Create(cam, info, {CFrame = workspace.Cam.CFrame})
local tween1 = ts:Create(cam, info1, {CFrame = char:WaitForChild("Head").CFrame})

cam.CameraType = Enum.CameraType.Scriptable
task.wait()
tween:Play()
tween.Completed:Wait()
task.wait(1)
tween1:Play()
tween1.Completed:Wait()
task.wait(.2)
cam.CameraType = Enum.CameraType.Custom
event:FireServer()

end)

Output: nothing…

I have no idea what this could be. Please help.

1 Like

The blockcode didnt work so sorry about that

Try adding a print(event.Name) and a print(event.Parent) in the client script just to make sure its getting the right one. Otherwise im not 100% sure whats going wrong

2 Likes

Probably because the player didn’t join the server by the time :FireAllClients is called.

1 Like

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