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

My script only works with leaderstats without giving the tool?

Asked by 4 years ago

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)
0
aaaaa, I can't tell if I've made any mistakes within the typing- I have mild dyslexia :/ ToastyXoYT 5 — 4y
0
your typing is fine krowten024nabrU 463 — 4y
0
yes because I have to read through it before i made sure its alright. ToastyXoYT 5 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

Try remove this line: script.Parent.BrickColor.new("Bright red")

If this doesn't work, please tell me the error in output.

Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Change the bright red color line to the script below.

script.Parent.BrickColor = BrickColor.new("Bright red")

Answer this question