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

How do I make a a shop for cars?

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
Please put your code in a code block! Shawnyg 4330 — 8y
0
So I should take the code and stick it inside a block? I insert the local script into a block, Is that it? Caradarksguns 5 — 8y

Answer this question