Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i make the script behind a simulator shop?

So im making a new simulator game, but the old shop scripts from tutorials dont work after some updates of roblox... Please tell me how i can make a shop

1 answer

✓ Accepted answer

Ok ill help you with some things

local Cash = script.Parent.Parent.Parent.Parent.Parent -- Script > Textbutton > Frame > ScreenGui > PlayerGui > Player
local Item = game.Lighting.Item
local Backpack = script.Parent.Parent.Parent.Parent.Parent.Backpack

script.Parent.MouseButton1Click:Connect(function()
	if Cash.Value >= 5000 then -- Item costs 5000 Cash
	Item.Clone(Backpack)
	Cash.Value = Cash.Value - 5000
	elseif Cash.Value < 5000 then
	script.Parent.Text = "Item costs too much!"
	wait(1.5)
	script.Parent.Text = "Item - 5000 Cash"
end)

If something doesn't work tell me

1 comment

0

I forgot that Cash has to be script.Parent.Parent.Parent.Parent.Parent.leaderstats.Cash

This discussion is preserved as it was. New answers, comments, and votes are closed.