Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I spawn cars?

Asked by 10 years ago

I am thinking of making a ScreenGui that people could click to purchase a car that would spawn infront of them.** My main questions:**

How would I spawn the cars? (From Replicated Storage) How do I make the car spawn in front of a player?

I also am thinking of making a license plate that randomly changes with each car. I am thinking of adding a billboard Gui to the plate and making it random. Do I use Randommath?

Please excuse all my questions as I am very novice to Lua but have large ambitions.

2 answers

Log in to vote
0
Answered by
wjs3456 90
10 years ago

Okay I'm not very good either but since you don't have any answers yet, I'll try to answer your first question. No promises it will work as I haven't got to try it.

function clonecar()
    local regen = script.Parent --This is the is the regen button. This script should be in it.
    local new_item = game.Lighting.Car--Or whatever you want the name of it to be. It should be in the lighting.
    new_item:clone().Parent = game.Workspace--cloning the car into workspace
    new_item.Position = Vector3.new(x,y,z)--not posotive here as I'm not very good but you just need set the x, y, and z
    wait(10)--before used again
end

script.Parent.ClickDetector.Clicked:connect(clonecar)--you will need to insert a ClickDetector in the regen.

Hope this can help!

0
Not exactly what I need, but thanks for atleast answering! Champion121212 22 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

When you build you game and if you use free models you can go there and type in cars and then sometimes they come with the spawn.

0
If I wanted to use freemodels, I wouldn't be here. Plus freemodel cars don't come with a Gui spawn. Champion121212 22 — 10y
0
uh ok melaniesky 0 — 10y

Answer this question