Log in to vote

How do you make a brick that changes the bool value and exchanges for money script?

Asked by 4 months ago

I am making a game similar to cook burgers but more like work at a pizza place and I have tried to make a script that changes the color of a brick, changes the bool value, and if the bool value is true deletes the part and exchanges it for money. The color works fine, but the bool value changer and money brick don't work. Here is the bool value changer script:

    local Cooked = hit.Parent:FindFirstChild("Cooked")
    Cooked.Value = true

Here is the script that is meant to exchange the brick for money:

function onTouched(hit)
    if hit.Parent:FindFirstChild("MeatPatty") then
        local cash = 50
        local Cooked = hit.Parent
        if cooked.value == true then
            leaderstats.Money = money + cash


If anyone could tell me what I'm doing wrong and help me change it, it would be very appreciated. Ciao!

Answer this question