Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a gui car spawner?

I have the GUI and I have the position of the car, located in serverstorage. I'm not sure how to make the car spawn and be drivable, as looking at spawn buttons it looks very complicated. Please help.

2 comments

0

You need to provide some sort of scripts so that we can work on it and refer to it.

0

I'd love to help but I need some reference to see what's going on here.

1 answer

✓ Accepted answer

Honestly, it is not complicated! Put a local script in your button, then we code he mousebutton1down event!

local button = script.Parent -- we get the button we want to click
local car = game.ServerStorage.Car -- we get the car


button.MouseButton1Down:connect(function() -- we check to see if the player has clicked the mouse

	car:Clone() -- clone the car
	car:Clone().Parent = workspace
	car:Clone().Position = Vector3.new(--whatever) -- if so, we clone the car, change the parent to workspace, and if needed, change the position!
	
end)

This should all work! Tested it on my laptop and worked great! Please upvote if worked!

5 comments

0

if FE is turned on you will need to have some remote events fire so the whole server can see.

0

Thank you, it worked well! Sorry I cant upvote, i don't have enough rep, but I thank you dearly!

0

Thats fine!

0

How would we mod this script so that it also checks if the player's currency is enough to buy it. And how would you do it with FE remove events?? Im a beginner so assume I know nothing. Thanks!! Your help would be HUGELY appreciated.

0

idk how to do this I click on it and nothing happens

This discussion is preserved as it was. New answers, comments, and votes are closed.