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

How do I make a car shop? REPOST

Hello, I have been trying to make a brick that you can click, then it shows a GUI (Price of the car, etc.) with a purchase button. You are able to click this then it subtracts from your leaderboard value, spawning in the vehicle around the back of the dealership.

Heres what I did,

Leaderboard with a currency called Money

Grouped the car and stuck it into lighting

Created a brick with the click interest thing ( sorry for not knowing proper name)

added a Gui to the brick

Added this local script I found on another forum because I am too dumb for LUA

changed it to suit my game

local model = game.Lighting.CARNAME local character = game.Players.LocalPlayer.Character local Currecy = game.Players.LocalPlayer.leaderstats.CURRENCYNAME local Price = CARPRICE

function onClicked() if Currency.Value >= Price then Currency.Value = Currency.Value - Price local a = model:clone() a.Parent = game.Workspace wait() a:MakeJoints() wait() a:MoveTo(character.Torso.Position + Vector3.new(0,0,10)) end end script.Parent.MouseButton1Click:connect(onClicked)

*****Now I can click the brick with the correct amount of cash

nothing happens*****

*Also I was using this forum for support but I found it confusing and frustrating, so heres what I was trying * (http://http://forum.roblox.com/Forum/ShowPost.aspx?PostID=47665591)

Please help me.

6 comments

0

Are you trying to use a ClickDetector?

0

You need to put your code in a code block. It's the blue lia button.

0

Did you change "CARNAME", "CURRENCYNAME", and "CARPRICE" to the appropriate values before starting the game?

0

First question, yes.

0

Second, so I take my script and add it into a code block? Can somebody explain where I find this and what it does?

0

Third, yes I did. Also I may have a way around this whole thing, I'll keep you up to date.

1 answer

I think you should swith onClicked to onClick. That is what I do.

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