there is 8 different carts red, blue, green, yellow, orange, purple, white, black the text buttons are inside of a shop frame then the shop frame is inside a shopgui every button has a int value of its price and name and below is inside a local script in each text button.

local rs = game:GetService("ReplicatedStorage") local kart = game.ServerStorage.RedKart local PlayerP = player.Character.Head.Position

local function initialize() local Kart = kart:Clone() Kart.Name = "Kart" Kart.Parent = game.Workspace Kart.Main.Position = PlayerP + Vector3.new (0,0,-5) Kart:MakeJoints() wait(60) Kart:Destroy() end

local function CoolDown() wait(10) end

button.MouseButton1Click:connect(function() if leaderboard.Coins.Value >= price.Value then -- Change "Coins" to your currency name... leaderboard.Coins.Value = leaderboard.Coins.Value - price.Value initialize() CoolDown() end end)

while wait() do button.Text = item.Value.." - "..price.Value end

PLEASE TELL ME IF I LEFT OUT ANYTHING YOU NEED TO KNOW TO HELP. and thank you.

3 comments

0

Heard of code blocks?

0

no i havent

0

Local Script can't access ServerStorage in real servers