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

How do i make the script behind a simulator shop?

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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

0
I forgot that Cash has to be script.Parent.Parent.Parent.Parent.Parent.leaderstats.Cash DindinYT37 246 — 4y
Ad

Answer this question