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

i have a text button to buy carts that only works in testing mode?

Asked by 6 years ago

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.

0
Heard of code blocks? User#19524 175 — 6y
0
no i havent Chipped_Cookie -2 — 6y
0
Local Script can't access ServerStorage in real servers TheSkyofIndia 150 — 6y

Answer this question