- What do you want to achieve? Keep it simple and clear!
so i want to make an intermission system but somehow the event on the server code wont fire
- What is the issue? Include screenshots / videos if possible!
the first fireallclient line was not fired somehow
SERVER CODE:
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local gameEvent = ReplicatedStorage:WaitForChild("GameEvent")
local Settings = require(script.GameSettings)
local intermission = true
while true do
intermission = true
-- the event that wont fire
gameEvent:FireAllClients(intermission)
task.wait(Settings.IntermissionTime)
intermission = false
gameEvent:FireAllClients(intermission)
task.wait(Settings.InGameTime)
end
CLIENT CODE:
local RS = game:GetService("ReplicatedStorage")
local gameEvent = RS:WaitForChild("GameEvent")
local camera = workspace.CurrentCamera
local campart = workspace:WaitForChild("Campart")
local connection
local renderconnection
local Intermission = true
connection = camera:GetPropertyChangedSignal("CameraType"):Connect(function()
if camera.CameraType ~= Enum.CameraType.Scriptable then
camera.CameraType = Enum.CameraType.Scriptable
end
end)
renderconnection = game:GetService("RunService").RenderStepped:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = campart.CFrame
end)
gameEvent.OnClientEvent:Connect(function(intermission)
if intermission == false then
print(intermission)
Intermission = intermission
connection:Disconnect()
renderconnection:Disconnect()
elseif Intermission == true then
Intermission = intermission
print(intermission)
connection = camera:GetPropertyChangedSignal("CameraType"):Connect(function()
if camera.CameraType ~= Enum.CameraType.Scriptable then
camera.CameraType = Enum.CameraType.Scriptable
end
end)
renderconnection = game:GetService("RunService").RenderStepped:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = campart.CFrame
end)
end
end)
thanks for your help