Having some troubles with "WaitFor and FindFirst"? in multiple inserted models from another script
So essentially, I have a script that clones maps from the Lighting (inefficient I know, should be in ReplicatedStorage), but it inserts them fine however I keep running into trouble is when I click on this script which is in a textbutton, it always searches for the first model but never the second or etc however many maps I include. Could anyone shed some light onto how I might be able to fix this?
01 | local SpawnPos = game.Workspace:WaitForChild(( 'MapNameSpawns' or '' or '' )):GetChildren() |
02 | local plr = game.Players.LocalPlayer |
03 | local char = plr.Character |
04 | if not char or not char.Parent then |
05 | char = plr.CharacterAdded:wait() |
13 | local CSpawn = SpawnPos [ math.random( 1 , #SpawnPos) ] |
14 | local FindValue = game.Players.LocalPlayer.CharStorage:WaitForChild( "NameValue" ) |
15 | if FindValue.Value = = true then |
16 | char:MoveTo(CSpawn.Position) |
17 | script.Parent.Parent.Visible = false |
18 | script.Parent.Parent.Parent.TextButton.Visible = false |
20 | if FindValue = = false then |