of     1   

stroudie
#64050513Friday, March 09, 2012 9:06 PM GMT

I've been struggling to get my spawn system working for the past few days due to the "MoveTo" method not doing its job. Just as a check though... here's my script. Tell me if you see anything wrong. --Hostiles Drone = game.Lighting:FindFirstChild("Drone") Drone2 = game.Lighting:FindFirstChild("Drone") Drone3 = game.Lighting:FindFirstChild("Drone") Drone4 = game.Lighting:FindFirstChild("Drone") Sniper = game.Lighting:FindFirstChild("Sniper") Sniper2 = game.Lighting:FindFirstChild("Sniper") Sniper3 = game.Lighting:FindFirstChild("Sniper") Sniper4 = game.Lighting:FindFirstChild("Sniper") Worker = game.Lighting:FindFirstChild("Worker") Worker2 = game.Lighting:FindFirstChild("Worker") Worker3 = game.Lighting:FindFirstChild("Worker") Worker4 = game.Lighting:FindFirstChild("Worker") Defender = game.Lighting:FindFirstChild("Defender") Defender = game.Lighting:FindFirstChild("Defender") Defender = game.Lighting:FindFirstChild("Defender") Defender = game.Lighting:FindFirstChild("Defender") MasterDrone = game.Lighting:FindFirstChild("MasterDrone") OverDrone = game.Lighting:FindFirstChild("OverDrone") --SpawnValues Spawn1Value = game.Workspace:FindFirstChild("Part1SpawnAI") --SpawnLocations Spawn1ValueA = Vector3.new(-513.5, 194.5, -786.5) Spawn1ValueB = Vector3.new(-589.5, 194.5, -861.5) Spawn1ValueC = Vector3.new(-538, 197, -820.5) Spawn1ValueD = Vector3.new(-533, 197, -812.5) Spawn1ValueE = Vector3.new(-547, 221, -787.5) Spawn1ValueF = Vector3.new(-588.5, 221, -793) --Number of AI Part1DroneNumber = 4 Part1SniperNumber = 2 --Other DetectAIScript = game.Lighting.CheckRemove function SpawnAI() if Spawn1Value.Value == true and Spawn1Value.IsPresent.Value == false then --For a new Spawn area, copy from here Spawn1Value.Value = false Spawn1Value.IsPresent.Value = true Model = Instance.new("Model") Model.Name = ("AISpawn1") Model.Parent = game.Workspace DeadValue = Instance.new("IntValue") DeadValue.Parent = Model DeadValue.Name = "DeadMaxValue" DeadValue.Value = Part1DroneNumber + Part1SniperNumber DeadValue2 = Instance.new("IntValue") DeadValue2.Parent = Model DeadValue2.Name = "DeadValue" DeadValue2.Value = 0 NameValue = Instance.new("StringValue") NameValue.Parent = Model NameValue.Name = "NameValue" NameValue.Value = Spawn1Value.Name DetectAIScript:Clone().Parent = Model Drone:Clone().Parent = Model --Change "Drone" etc after copying section if required Drone:MakeJoints() wait(0.5) Drone:MoveTo(Spawn1ValueA) Drone2:Clone().Parent = Model Drone2:MakeJoints() wait(0.5) Drone2:MoveTo(Spawn1ValueB) Drone3:Clone().Parent = Model Drone3:MakeJoints() wait(0.5) Drone3:MoveTo(Spawn1ValueC) Drone4:Clone().Parent = Model Drone4:MakeJoints() wait(0.5) Drone4:MoveTo(Spawn1ValueD) Sniper:Clone().Parent = Model Sniper:MakeJoints() wait(0.5) Sniper:MoveTo(Spawn1ValueE) Sniper2:Clone().Parent = Model Sniper2:MakeJoints() wait(0.5) Sniper2:MoveTo(Spawn1ValueF) end --To here, also change values at the top. This whole section does all the spawning for the first section/area of the game end Spawn1Value.Changed:connect(SpawnAI) No output errors.
stroudie
#64050584Friday, March 09, 2012 9:07 PM GMT

Oops. Make that the following instead (a slight addition I spotted was needed). The annotations are for when my friend needs to edit this (if he pleases). --Hostiles Drone = game.Lighting:FindFirstChild("Drone") Drone2 = game.Lighting:FindFirstChild("Drone") Drone3 = game.Lighting:FindFirstChild("Drone") Drone4 = game.Lighting:FindFirstChild("Drone") Sniper = game.Lighting:FindFirstChild("Sniper") Sniper2 = game.Lighting:FindFirstChild("Sniper") Sniper3 = game.Lighting:FindFirstChild("Sniper") Sniper4 = game.Lighting:FindFirstChild("Sniper") Worker = game.Lighting:FindFirstChild("Worker") Worker2 = game.Lighting:FindFirstChild("Worker") Worker3 = game.Lighting:FindFirstChild("Worker") Worker4 = game.Lighting:FindFirstChild("Worker") Defender = game.Lighting:FindFirstChild("Defender") Defender2 = game.Lighting:FindFirstChild("Defender") Defender3 = game.Lighting:FindFirstChild("Defender") Defender4 = game.Lighting:FindFirstChild("Defender") MasterDrone = game.Lighting:FindFirstChild("MasterDrone") MasterDrone2 = game.Lighting:FindFirstChild("MasterDrone") MasterDrone3 = game.Lighting:FindFirstChild("MasterDrone") MasterDrone4 = game.Lighting:FindFirstChild("MasterDrone") OverDrone = game.Lighting:FindFirstChild("OverDrone") OverDrone2 = game.Lighting:FindFirstChild("OverDrone") OverDrone3 = game.Lighting:FindFirstChild("OverDrone") OverDrone4 = game.Lighting:FindFirstChild("OverDrone") --SpawnValues Spawn1Value = game.Workspace:FindFirstChild("Part1SpawnAI") --SpawnLocations Spawn1ValueA = Vector3.new(-513.5, 194.5, -786.5) Spawn1ValueB = Vector3.new(-589.5, 194.5, -861.5) Spawn1ValueC = Vector3.new(-538, 197, -820.5) Spawn1ValueD = Vector3.new(-533, 197, -812.5) Spawn1ValueE = Vector3.new(-547, 221, -787.5) Spawn1ValueF = Vector3.new(-588.5, 221, -793) --Number of AI Part1DroneNumber = 4 Part1SniperNumber = 2 --Other DetectAIScript = game.Lighting.CheckRemove function SpawnAI() if Spawn1Value.Value == true and Spawn1Value.IsPresent.Value == false then --For a new Spawn area, copy from here Spawn1Value.Value = false Spawn1Value.IsPresent.Value = true Model = Instance.new("Model") Model.Name = ("AISpawn1") Model.Parent = game.Workspace DeadValue = Instance.new("IntValue") DeadValue.Parent = Model DeadValue.Name = "DeadMaxValue" DeadValue.Value = Part1DroneNumber + Part1SniperNumber DeadValue2 = Instance.new("IntValue") DeadValue2.Parent = Model DeadValue2.Name = "DeadValue" DeadValue2.Value = 0 NameValue = Instance.new("StringValue") NameValue.Parent = Model NameValue.Name = "NameValue" NameValue.Value = Spawn1Value.Name DetectAIScript:Clone().Parent = Model Drone:Clone().Parent = Model --Change "Drone" etc after copying section if required Drone:MakeJoints() wait(0.5) Drone:MoveTo(Spawn1ValueA) Drone2:Clone().Parent = Model Drone2:MakeJoints() wait(0.5) Drone2:MoveTo(Spawn1ValueB) Drone3:Clone().Parent = Model Drone3:MakeJoints() wait(0.5) Drone3:MoveTo(Spawn1ValueC) Drone4:Clone().Parent = Model Drone4:MakeJoints() wait(0.5) Drone4:MoveTo(Spawn1ValueD) Sniper:Clone().Parent = Model Sniper:MakeJoints() wait(0.5) Sniper:MoveTo(Spawn1ValueE) Sniper2:Clone().Parent = Model Sniper2:MakeJoints() wait(0.5) Sniper2:MoveTo(Spawn1ValueF) end --To here, also change values at the top. This whole section does all the spawning for the first section/area of the game end Spawn1Value.Changed:connect(SpawnAI)
GrandAwsome
#64050775Friday, March 09, 2012 9:11 PM GMT

MoveTO method isnt broken, its just like using CFraming to teleport things, somethimes you may have to use MoveTo() more then once to move things
stroudie
#64051022Friday, March 09, 2012 9:16 PM GMT

Do you know whether you're helping or not?
stroudie
#64066666Saturday, March 10, 2012 1:36 AM GMT

Any ideas?
malachi11
#64072395Saturday, March 10, 2012 3:10 AM GMT

Drone:MoveTo(Spawn1ValueA.Value) Same with all the others. :P
malachi11
#64072458Saturday, March 10, 2012 3:11 AM GMT

I fail... I though it was a Vector3Value object.
stroudie
#64086673Saturday, March 10, 2012 11:04 AM GMT

>_> Anyone else got any ideas?
Jlobblet
#64088218Saturday, March 10, 2012 12:55 PM GMT

MoveTo(Spawn1PlaceA.X,Spawn1PlaceA.Y,Spawn1PlaceA.Z) I think it works :3
stroudie
#64088669Saturday, March 10, 2012 1:16 PM GMT

I found the solution. I'm annoyed at myself now. I was using the "MoveTo" method on the models in lighting rather than their clones >_> Derp

    of     1