Incomplete statement: expected assignment or a function call

So, I am in trouble, in my code, for some reason there is an error (as in name of this arcticle) and doesn’t work. Please help me!
Error: Error: (14,2) Syntax error: Incomplete statement: expected assignment or a function call
Code:

if player.leaderstats.EXP.Value >= exprequired then
	print("test")
	player.leaderstats.Levels.Value + 1 --THIS 
end

Thanks!

Try using the += syntax for this. Another option would be to write it as:

player.leaderstats.Levels.Value  = player.leaderstats.Levels.Value + 1

But that’s lengthy and harder to read. Write it like this.

player.leaderstats.Levels.Value += 1

Oh, I see! Thanks alot! I didn’t even think about it.

1 Like

And also, if you have some more time, can you help me with this?

Players.LugStory.PlayerScripts.LocalScript:11: attempt to perform arithmetic (pow) on number and Instance - Client - LocalScript:11

local exprequired = 100*(1.15^Levels)

It does for me, working fine! But there are lot of other errors in my script.

Levels is an Instance.
Do Levels.Value

2 Likes