The answer to this is make sure that there is no two while true do loops like this!
p = 1
r = 3
while p == 1 do
while r == 3 do
wait(0.1)
p = p - 1
print("Loop")
end
end
Player = game.Players
PN = game.ReplicatedStorage.MainValues.PlayerNeeded
PC = game.ReplicatedStorage.MainValues.PlayerCheck
PA = game.ReplicatedStorage.Values.PlayerAmount
Player.PlayerAdded:Connect(function(Added)
PA.Value = PA.Value + 1
end)
Player.PlayerRemoving:Connect(function(Removing)
PA.Value = PA.Value - 1
end)
while PC.Value == true do
wait(1)
if PA.Value >= 2 then
print("EnoughPlayers")
PN.Value = false
PC.Value = false
print(PN.Value)
end
end
On 0.2nd second its supposed to stop right? wrong it keeps going and doesn't bother to go back clearly because it wants to restart there it goes like simple knowledge while true do --> do something --> go back to the same while true do.
And to answer this question I needed to add value for player leave or join. I temporarly removed something cause it would loop and lag.
4 comments
Ok Makes sence Ill try that
Sorry It Did not work
if you manually change the playernumber value does it work?
I fixed It I will close it and to be honest thank you, i needed to get out of that way of making .Value and the end of every shortcut ya know?