Hppolice
|
  |
| Joined: 06 Feb 2012 |
| Total Posts: 578 |
|
|
| 08 Aug 2014 04:38 PM |
Hello, I'm trying to creat a Spawn car on click script. I'm trying to figure out that when I click on a certain brick, the car in Lighting will duplicate it self on top of that brick, but I don't know whether it should be a model and what the outermost name should be to the inner most.
For example, I thought the Model would be called Parking Spots, then inside it is a Model called Car Holder, and 2 brick inside are called Parking Spots. Can you help me organize what goes where?
Script:
function clear()
local kid = script.Parent.Parent.Parent
local char = kid.Character:GetChildren() for i = 1,#char do if char[i].Name == "VS3" then char[i]:Destroy() end end
local tools = kid.Backpack:GetChildren() for i = 1,#tools do if tools[i].Name == "Ranger" or tools[i].Name == "SS" or tools[i].Name == "Fourta" or tools[i].Name == "S5" then tools[i]:Destroy() end end
local spawns = game.Workspace["Parking Spots"]:GetChildren() for i = 1,#spawns do if spawns[i].Name == "Car Spawn" then local cars = spawns[i]["Car Holder"]:GetChildren() for k = 1,#cars do if cars[k]:FindFirstChild(kid.Name) then cars[k]:Destroy() end end end end
end
function Select(Mouse)
Mouse.Button1Down:connect(function() local kick = Mouse.Target if kick ~= nil then if kick.Name == "Car Spawn" then clear() local car = game.Lighting.Cars[script.Parent.Name]:clone()
local grab = kick.Parent["Car Holder"]:GetChildren() for i = 1,#grab do grab[i]:Destroy() end
local tag = Instance.new("IntValue") tag.Name = script.Parent.Parent.Parent.Name tag.Parent = car
car:MakeJoints() car.Parent = kick.Parent["Car Holder"] car:MakeJoints() car:MoveTo(kick.Position) car:MakeJoints()
wait(1)
car.VS3.Parts.Script.Disabled = false car.VS3.Parts.Speed.Disabled = false car.VS3.Parts.Lights.Activated.Disabled = false car.VS3.Parts.Lights.Director.Disabled = false car.VS3.Parts.Doors.WeldScript.Disabled = false car.VS3.Parts.Doors.WeldScript.Disabled = false end end end)
end
script.Parent.Selected:connect(Select)
---------- Thank you for your help! I really appriciate it! Hppolice
|
|
|
| Report Abuse |
|
|
Hppolice
|
  |
| Joined: 06 Feb 2012 |
| Total Posts: 578 |
|
| |
|
Hppolice
|
  |
| Joined: 06 Feb 2012 |
| Total Posts: 578 |
|
| |
|
Sadcamp
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 21729 |
|
|
| 08 Aug 2014 04:53 PM |
like the car spawning system at USA uses?
i can dig up an old copy of usa's DC and probably get you the car regen thing as a model
screw it, i'm a penguin. i love c&g's faces. Artistically Insane. It's what's inside the machine that's brilliant. |
|
|
| Report Abuse |
|
|
Hppolice
|
  |
| Joined: 06 Feb 2012 |
| Total Posts: 578 |
|
|
| 08 Aug 2014 04:54 PM |
| Yeah, does anyone have a set DC car spawn plus tools? |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2014 04:54 PM |
idk what your trying to do... to spawn a car you do something like this
function spawncar() car = game.Lighting.car:Clone() car:MakeJoints() car.Parent = Workspace car.Position = Vector3.new(0,0,0)
--any other properties can go here
end
part.OnClick:connect(spawncar()) |
|
|
| Report Abuse |
|
|
Sadcamp
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 21729 |
|
|
| 08 Aug 2014 04:56 PM |
I know I have a copy of DC somewhere, but an older version. The car spawners should pretty much be the same as they are in the modern version.
I'll go and see if I can find it.
screw it, i'm a penguin. i love c&g's faces. Artistically Insane. It's what's inside the machine that's brilliant. |
|
|
| Report Abuse |
|
|
Hppolice
|
  |
| Joined: 06 Feb 2012 |
| Total Posts: 578 |
|
|
| 08 Aug 2014 04:56 PM |
I'm trying create the brick in which the car spawns, this script should work. All I'm trying to do is create the actual brick that the car is to spawn on, and how do I do that based on this script? Do I put a model name yadayada first, or what?
Thanks for the help though. |
|
|
| Report Abuse |
|
|