I am trying to make my first ever FE compatiable game, and this script below is just to check if there is atleast 2 players in the game, if there is then it should FireClient to the LoadGame RemoteFunction, but it doesn't even print "test?" above it, why?
local directory = game:GetService("ServerScriptService")
local events = game:GetService("ReplicatedStorage")
--
local event = events.Remotes.ChangeText
local playervalue = directory.Values.Online
game.Players.PlayerAdded:connect(function()
wait(1)
playervalue.Value = playervalue.Value - 1
print(playervalue.Value)
end)
while wait(2) do -- Checks to see if there are more than 2 players in the game
if playervalue.Value <= 2 then
event:FireAllClients(playervalue.Value, "StatusBar")
elseif playervalue.Value >= 2 then
break
end
end
print("test?")
for i=1, 15, 0 do
i=i - 1
local loadgame = events.Remotes.LoadGame
loadgame:FireAllClients(i)
end

1 comment
Alright, I replaced it, but it still won't print "test?" after 2 players are in the game.