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 shop? REPOST

Asked by 8 years ago

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.

0
Are you trying to use a ClickDetector? XAXA 1569 — 8y
0
You need to put your code in a code block. It's the blue lia button. User#11440 120 — 8y
0
Did you change "CARNAME", "CURRENCYNAME", and "CARPRICE" to the appropriate values before starting the game? darkelementallord 686 — 8y
0
First question, yes. Caradarksguns 5 — 8y
View all comments (2 more)
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? Caradarksguns 5 — 8y
0
Third, yes I did. Also I may have a way around this whole thing, I'll keep you up to date. Caradarksguns 5 — 8y

1 answer

Log in to vote
0
Answered by 5 years ago

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

Ad

Answer this question