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

How do I make a car spawner? [closed]

Asked by 5 years ago

I know this has been answered a lot of times. But what I mean is, How do I make a gui where if you click or step on a button. It will give you a choice of what car you want to spawn, not just one car.

0
scriptinghelpers.org is **NOT** a request site , Don't ask others to make codes for you maumaumaumaumaumau 98 — 5y

Closed as Not Constructive by Gey4Jesus69, User#21908, green271, and User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 5 years ago

This is a very easy thing to do but I'm here to teach you how to do it rather than showing you. So here are a few things to use for this:

If you want to make a GUI (either a surface or an on-screen one), I would recommend using the ".MouseButton1Click" function. There are easier ways of simplifying it rather than just making an individual function for each button but you can start here: https://www.robloxdev.com/api-reference/event/GuiButton/MouseButton1Click

If you want to make a "step-on" button (basically the one you touch in-game), I would recommend using the ".Touched" function. Again, there are simpler ways of simplifying this rather than making multiple functions but you can start here: https://www.robloxdev.com/api-reference/event/BasePart/Touched

You can also look up tutorials on YouTube; AlvinBLOX does amazing tutorials on teaching you how to use this. I would recommend watching his videos.

If you have any questions or issues, please contact me (I can teach you if you couldn't understand any of the methods above). ;)

Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Well, lets get the train going. Been a while since I was on this forum website. I don't actually feel like giving you the code but I would love to help you grasp a concept.

So first of all we're gonna tackle on how to make a new car. First when we want a new car to be placed we should have a backup or main object to copy from stored in ServerStorage or wherever you want it to be.

So whenever a player steps on it, it goes the following steps. (Pseudo Code)

Object:Clone()
Object.Parent = workspace
Object:MakeJoints() -- Prevents it from falling apart just incase

But then there is the issue where if you step on it, it spawns multiple. That is as easy as adding a debounce. (Pseudo Code)

Debounce = false
RegenTouched
if Debounce false then
Debounce = true
(Insert previous Pseudo Code here)
wait(5) -- How long you want it to wait before spawning a new one
Debounce = false

If you have anymore questions or any confusion let me know!

0
(I went on the stepped approach with a brick.) GetGlobals 343 — 5y