I’m trying to make a cutscene skip code, sending a :FireServer() event to add the player onto a table and see if the ammount of players is a certain ammount and if so it skips. I’ve been searching through everywhere and looking back at my code about 100 times still nothing as worked.
Local Script
while task.wait() do
if isHoldingSpace then
task.wait(.05)
holdingTime += .05
end
if not isHoldingSpace then
holdingTime = 0
end
if holdingTime >= 1.5 then
SkipEvent:FireServer(player)
end
end
SkipEvent.OnClientEvent:Connect(function()
print("I'm listening for FireAllClients")
end)
Script
SkipEvent.OnServerEvent:Connect(function(player)
if table.find(playersSkip, player) then
return
else
table.insert(playersSkip, player)
end
if #playersSkip == playersTotal then
print("Yes it's equal")
SkipEvent:FireAllClients()
table.clear(playersSkip)
end
end)
Thank you in advance.