|
| 13 Jan 2015 02:58 PM |
| Just seeing if there is anyone available to help me. :) |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jan 2015 03:02 PM |
"Vehicle" Is not spawning at any one of the two locations that is randomly selected.
--- Hard = 1 --- Medium = 2 --- Soft = 3 --- Supersoft = 4
--- Red = "Bright red" --- Yellow = "Bright yellow" --- Green = "Bright green" --- Blue = "Bright blue" --- Purple = "Bright violet" math.random(tick())
spawnone = game.Workspace.Spawn1 spawntwo = game.Workspace.Spawn2 --- where the four spawns are person = script.Parent.Parent.Parent.Parent.Character disabled = false --- disable use after click car = game.Workspace.Vehicle carspawn = (math.random(1, 2))
function spawn() car = game.Workspace.Vehicle:Clone() car.Parent = game.Workspace car:MakeJoints() wait() if carspawn == 1 then car:MoveTo(Vector3.new(spawnone.Position))
elseif carspawn == 2 then car:MoveTo(Vector3.new(spawntwo.Position))
car.Name = "CAR" script.Parent.Visible = false car.Remover.Disabled = false wait() disabled = true end end
script.Parent.Spawn.MouseButton1Click:connect(spawn)
---removed irrelevant stuff from the script.
|
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:04 PM |
May I have the order of everything? It helps me understand it better. |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jan 2015 03:07 PM |
I think he means with order the locations of all the stuff. Like:
Workspace -- Part ---- Script -- BasePlate -- Terrain ---- LocalScript |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:07 PM |
Yes please.
(ROBLOX is limiting my posts now. Since I am helping so many people...)
|
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:09 PM |
Vehicle and Spawn1 and Spawn 2 are in WorkSpace. The script is in startergui - ScreenGui - Frame.Creation
thank you. |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:11 PM |
| Could you give me in the order that Elite suggested? |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:13 PM |
game -Workspace --Spawn1 --Spawn2 --Vehicle --BasePlate
StarterGUI -ScreenGui --Frame ---SCRIPT < that one.
I presume this is correct? |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:14 PM |
| It is just the Random function not working, It clones the car and it is fine, it is just not cloning it to the correct vector3 position, which is one of the two spawn locations (Spawn1 or Spawn2) |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:23 PM |
--- Red = "Bright red" --- Yellow = "Bright yellow" --- Green = "Bright green" --- Blue = "Bright blue" --- Purple = "Bright violet" math.random(tick())
local spawnone = game.Workspace.Spawn1 local spawntwo = game.Workspace.Spawn2 --- where the four spawns are local person = script.Parent.Parent.Parent.Parent.Character local disabled = false --- disable use after click local car = game.Workspace.Vehicle local carspawn = (math.random(1, 2))
function spawn() local carCopy = car:Clone() carCopy.Parent = game.Workspace car:MakeJoints() wait() if carspawn == 1 then carCopy:MoveTo(Vector3.new(spawnone.Position))
elseif carspawn == 2 then carCopy:MoveTo(Vector3.new(spawntwo.Position))
carCopy.Name = "CAR" script.Parent.Visible = false carCopy.Remover.Disabled = false wait() disabled = true end end
script.Parent.Spawn.MouseButton1Click:connect(spawn)
Try That, if that doesn't work. Then I think the: carCopy.Name = "CAR" script.Parent.Visible = false carCopy.Remover.Disabled = false wait() disabled = true end end
Only works when the value is 2. |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:24 PM |
| Hmmm, Set the PrimaryPart of the Car to the Part you want Car to be. |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:26 PM |
| Does this have to be a local script or a regular script? |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jan 2015 03:29 PM |
| Both still just spawn in a random place, not at the .position of Spawn1 or Spawn2. |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:31 PM |
What happens to them? Do they like fly up? Or spawn like 100 Studs away etc? |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:37 PM |
| They spawn in the incorrect place. Nothing happens to them. |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jan 2015 03:42 PM |
| Is Spawn1 and Spawn2 Cancollide false? |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:44 PM |
| Yes, the vehicle is not even spawning anywhere near them, it is spawning in the center of the base plate |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:47 PM |
--- Red = "Bright red" --- Yellow = "Bright yellow" --- Green = "Bright green" --- Blue = "Bright blue" --- Purple = "Bright violet" math.random(tick())
local spawnone = game.Workspace:WaitForChild("Spawn1") local spawntwo = game.Workspace:WaitForChild("Spawn2") --- where the four spawns are local person = script.Parent.Parent.Parent.Parent.Character local disabled = false --- disable use after click local car = game.Workspace:WaitForChild("Vehicle") local carspawn = (math.random(1, 2))
function spawn() local carCopy = car:Clone() carCopy.Parent = game.Workspace carCopy:MakeJoints() wait() if carspawn == 1 then carCopy:MoveTo(Vector3.new(spawnone.Position))
elseif carspawn == 2 then carCopy:MoveTo(Vector3.new(spawntwo.Position)) end carCopy.Name = "CAR" script.Parent.Visible = false carCopy.Remover.Disabled = false wait() disabled = true end
script.Parent.Spawn.MouseButton1Click:connect(spawn)
Try that. |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:51 PM |
| It's like the position thing is not working, although the rest of the script is. |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 03:52 PM |
| I have to go bed now, I'll check tomorrow. Hopefully someone will help you. |
|
|
| Report Abuse |
|
|
| |
|