Attempt to perform arithmetic (add) on number and nil

What is addExp?

more characters

Yeah I’m usuing IntValue since no point use numberValue

Please show us line 34 of the script

It’s addApple but I showed the old one script so I screenshoted new one and you can check it out

When is this IntValue being created?

If it’s created by the client, then you’re attempting to identify an instance that does not exist on the server.

If it’s created on the server, then it should be visible. Which means your problem persists elsewhere.

EDIT: Also, to reference the IntValue’s value, it’s IntValue.Value

modules.addApple doesn’t return any value. you are trying to set plr.Apples.Value to a function call that returns nothing

Yes I did check it out

Why do we need 30

Everything is based of server side.

We have said that earlier check up more

Have you tried the following?

appleValue = plr.Apples.Value

ApplesCollected is not returning anything either so you are trying to set the value to I guess nil

1 Like

Yeah the module script already checking and making it into plr.Apples.Value so I can easily use plr.Apples since module turning it to plr.Apples.Value

I’m pretty sure it’s not the module fault, since I used or 0 and if the module gets nil then it should be replaced to 0

Here’s the issue I’m seeing.

When the OnServerEvent event gets triggered, it’s looking for the following object in this hierarchy on the server.

Apples Hierarchy

If that doesn’t exist, then you’re setting the value to a non existant object.

EDIT: This ocurrs on the appleValue declaration line.

Try this in the module do:

AappleValue.Value = applesCollected(appleValue, remainingapples)

And in the collected apples return remainingApple

Interesting, try make module that givex something and try use it as Remote, and when you fire it use something.Value += your_module(values,values), since i’m sure we should use something diff than just ā€˜+=’

Is plr.Apples a ModuleScript?

I used all values and also ā€˜return’ still the same error appears. :confused:

plr.Apples is stats.

like Player:FindFirstChild("Apples)