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

Shop GUI without Leaderboard?

Asked by 7 years ago

I made a shop GUI but instead of using "leaderstats" as the payment for an item and want to use my own currency gui. The scripts for both are down below.

Script for my own personal GUI:

fol = Instance.new("Folder", game.Workspace) fol.Name = "Data" game.Players.PlayerAdded:connect(function(plr) plrfol = Instance.new("Folder", fol) plrfol.Name = plr.Name val = Instance.new("NumberValue", plrfol) val.Value = 0 val.Name = "Socks" end)

game.Players.PlayerRemoving:connect(function(plr) fol[plr.Name]:Destroy() end)


Script for shop button:

player = script.Parent.Parent.Parent.Parent.Parent Cash = player.leaderstats.Cash -- Leaderstat: Change price = 30 -- Price :Change tool = game.Lighting:findFirstChild("GrapplingHook") -- Weapon Name: Change

--DO NOT CHANGE ANYTHING BELOW HERE function buy() if Cash.Value >= price then Cash.Value = Cash.Value - price local a = tool:clone() a.Parent = player.Backpack local b = tool:clone() b.Parent = player.StarterGear

end end script.Parent.MouseButton1Down:connect(buy)

0
price? I don't see it defined tho.. greatneil80 2647 — 7y
2
Please use codeblocks. KingLoneCat 2642 — 7y
0
ouch that formatting hurts gitrog 326 — 7y
0
Code block mannnn Abstract_Life 65 — 7y
0
yea but it in code blocks greatneil80 2647 — 7y

Answer this question