What i want to achieve? The cutscene plays on every client and the server waiting until the cutscene had finished
It won’t start if the player had AFK.
How i can improve this??
Thanks!
Client
print("bruh")
warn(script:GetFullName())
Camera = workspace.CurrentCamera
TS = game:GetService("TweenService")
Info = TweenInfo.new(3.5, Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
RS = game:GetService('RunService')
lastselected =nil
function TweenCamera(RelativePoint)
return RelativePoint
end
game.ReplicatedStorage.Network.Camera.Play.OnClientEvent:Connect(function(Points)
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = Points[1].CFrame
lastselected = Points[#Points]
for _,v in ipairs(Points) do
local Table = {
CFrame = v.CFrame
}
local Point = TS:Create(Camera,Info,Table)
Point:Play()
Point.Completed:Wait()
Point =nil
Table = nil
end
Camera.CameraType = Enum.CameraType.Custom
game.ReplicatedStorage.Network.Camera.Stop:FireServer() -- Fires on the server
end)
Server
Modules = game.ReplicatedStorage:WaitForChild("Modules")
GameModule = require(Modules.Game)
SoundSystem = require(Modules.SoundSystem)
Class = require(Modules.Class)
CS = game:GetService("CollectionService")
self = script.Parent
print("hey")
for i,v in pairs(game.Players:GetPlayers())do
if CS:HasTag(v.Character,"Contestant") then
if v.AFK.Value == true then
v.Character:BreakJoints()
else
print("heys")
game.ReplicatedStorage.Network.Gameplay.SwordEnable:FireClient(v)
game.ReplicatedStorage.Network.Camera.Play:FireClient(v,self.Parent.Cameras.Points:GetChildren()) -- fires on client
end
end
end
game.ReplicatedStorage.Network.Camera.Stop.OnServerEvent:Wait() -- Issue?
game.Chat.GameState.Value = "In-game"
SoundSystem:PlaySound(3064420455,true,"Change Theme")
--for i = 10,0,-1 do
-- GameModule:UpdateMsg("Count",tostring(i))
-- wait(1)
--end
wait(1)
for i = 120,0,-1 do
if #CS:GetTagged("Contestant") == 0 then
break
else
GameModule:UpdateMsg("Count",tostring(i))
end
if i == 30 then
SoundSystem:PlaySound(0,true,"Hurry up!")
end
wait(1)
end
for i,v in pairs(game.Players:GetPlayers())do
CS:RemoveTag(v.Character,"Contestant")
end
wait(1)
game.Chat.GameState.Value = "Finish"