Values are not changing?!

Hello!
Im making an game with computers, where i need to calculate the ram, but when i change a value it doesnt change… (mind that im doing this in a module script)
here is a small peace of the code:

local Ram_left = game:GetService("ReplicatedStorage").Ram

function Ram.Calc(NeadedRam, app)
    if Ram_left.Value >= (NeadedRam + 0.5) then
        Ram_left.Value = Ram_Value.Value - NeadedRam 
    end
end

in hindsight everything should work right?
but it doesnt for me…
any help would be appreciated!

If that function is called by a LocalScript then it will act as it is a function placed in a LocalScript.

A few things to check to diagnose:

  • Does game:GetService("ReplicatedStorage"):FindFirstChild("Ram") return nil?

    • If yes, then the object you’re referencing doesn’t exist
  • Does printing NeadedRam output nil?

    • If yes, then NeadedRam doesn’t exist
  • Does adding a print in your if-statement output anything?

    • If no, then your equality check has failed

Let me know how those go.

When you run the function, do any errors appear in the output? If so, send a screenshot of those errors so I can have a better look at what’s causing this to not work.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.