(local script stored in playercharacterscripts) while loop firing twice per iteration when it shouldnt be, what is going on?
local RS = game:GetService("ReplicatedStorage")
local Spawners =game.Workspace.MobSpawners:GetChildren()
print("number of spawners =", #Spawners)
local l = 1
while true do
task.wait(1)
for I,SpawnFolder in pairs(Spawners) do
print(l)
l+=1
end
end
Just curios, is this possibly running once in the PlayerCharacterScripts folder, and then also in the playerâs character once cloned?
if (game.Players.LocalPlayer.Character == script.Parent) then
local RS = game:GetService("ReplicatedStorage")
local Spawners =game.Workspace.MobSpawners:GetChildren()
print("number of spawners =", #Spawners)
local l = 1
while true do
task.wait(1)
for I,SpawnFolder in pairs(Spawners) do
print(l)
l+=1
end
end
end
you where right it was getting cloned the reason it was difficult to find was because it was cloning into a viewport frame so struggled to find it, anyway cheers