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

Human does not give value when clicked?

Asked by 4 years ago

Hello, i am making a clicker game that has 6 buildings and i implanted a data store system for saving cash, but i want it to save Buildings... and one specific building i want to test if it updates is Human. I want to test if Human can be saved and i put something in the script that makes it add value when it is clicked. But it is not working, so how do i fix this?

plr = script.Parent.Parent.Parent.Parent.Parent
Cost = script.Parent.BuildingCost.Cost
CPS = script.Parent.Parent.Parent.CPS
HumanValue = plr.leaderstats.Human.Value

script.Parent.MouseButton1Click:connect(function()
    if plr.leaderstats.Cash.Value >= Cost.Value then
        HumanValue = HumanValue + 1
        if true then
        plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value - Cost.Value
        script.Parent.BuildingCost.Cost.Value = script.Parent.BuildingCost.Cost.Value + 6
        script.Parent.BuildingCost.Text = "Requires $"..Cost.Value.. ""

        CPS.Value = CPS.Value + 1

        end
    end
end)

BTW: My old question didn't get any answers so i made a new question.

0
I don't understand what you're trying to do, also what human? User#17685 0 — 4y
0
Is this a local script or a normal one davidwym 32 — 4y
0
a normal script thelegendguy2 -54 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

This is the right way to do if you're changing its Value not just taking/referencing Value property

HumanValue = plr.leaderstats.Human; 

HumanValue.Value = HumanValue.Value + 1;
0
it works! thelegendguy2 -54 — 4y
0
Have fun :> User#17685 0 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

wait i also have another problem too

0
ask another question Fifkee 2017 — 4y

Answer this question