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)
Try remove this line: script.Parent.BrickColor.new("Bright red")
If this doesn't work, please tell me the error in output.
Change the bright red color line to the script below.
script.Parent.BrickColor = BrickColor.new("Bright red")