The script is meant to give the tool 'Drink' from replicated storage, but all what works is taking the currency 'Minutes' away without giving the tool. Have I made a mistake within my script? Have I done something wrong? I had to get this from a tutorial on youtube, and I'm not sure If I followed it correctly and I cannot find the issue. Thanks :)
local price = 12
local db = true
script.Parent.ClickDetector.MouseClick:connect(function(player)
if player.leaderstats.Minutes.Value >= price then
player.leaderstats.Minutes.Value = player.leaderstats.Minutes.Value - price
db = false
script.Parent.BrickColor.new("Bright red")
game.ReplicatedStorage.Drink:Clone().Parent = player.Backpack
wait (3)
script.Parent.BrickColor = BrickColor.new("Bright green")
db = true
end
end)

3 comments
aaaaa, I can't tell if I've made any mistakes within the typing- I have mild dyslexia :/
your typing is fine
yes because I have to read through it before i made sure its alright.