The game is basically an amusement park game. I have 2 currencies in my game, cash and tickets. Essentially start with cash, buy tickets for the rides, earn more cash through the rides and games to buy more tickets, etc. [it's a friend's idea but I'm curious as to how the gameplay will turn out]
So I have the leaderboard tracking the player's cash and tickets, and I decided it'd be fun to have the player use the cash and tickets as a tool. My issue is I don't want the player to hold up a ticket when they don't have one, and same going for cash.
Essentially, what is the actual code for if(Player.stat.Cash > 0) Player.BackPack.Money = true else Player.BackPack.Money = false end if(Player.stat.tix > 0) Player.BackPack.Tickets = true else Player.BackPack.Tickets = false end
Goal: If player has money, player may hold up and use money tool; if player has tickets, player may hold up and use ticket tool; if player has no money nor tickets, they do not have those tools available.
Here is an idea of what to do.
script.Parent.Equipped:Connect(function() -- Detect when the tool is equipped. if player.Stat.Cash.Value <= 0 then -- Detects if the cash is 0 or lower. script.Parent.Parent = player.Backpack; -- If it is, then put the tool back in the backpack. end end)