Leader stats with Admin Command

				--Give Cash
			elseif SplitCommand[1] == ":cash" or SplitCommand[1] == ":Cash" then
				local TargetedPlayer = SplitCommand[2]
				local CashAmout = SplitCommand[3]
				local Name = game.Players:FindFirstChild(TargetedPlayer)
				Name.Character.leaderstats.Value + CashAmout
				
				--Give Cash Player

Trying to make a Give Cash command. Any ideas on how to make it work? There’s a red underline saying incomplete statement.

1 Like

The reason why it says incomplete statement is because of this line right here;

Name.Character.leaderstats.Value + CashAmout

If you change the “+” to “+=” then it should get rid of that error.

It now says leaderstats isn’t a valid member of Workspace.DeveloperCoolBoi when I tried the command in the chat

leaderstats isn’t in character

Name.leaderstats.Value

What do you mean. I put a cash thing in leaderstats

yes but leaderstats folder isnt in character

Ok… Let me try something real quick

So like this?

				--Give Cash
			elseif SplitCommand[1] == ":cash" or SplitCommand[1] == ":Cash" then
				local TargetedPlayer = SplitCommand[2]
				local CashAmout = SplitCommand[3]
				local Name = game.Players:FindFirstChild(TargetedPlayer)
				Name.leaderstats.Value += CashAmout
				--Give Cash Player

Name.leaderstats.cashnamehere.Value

				--Give Cash
			elseif SplitCommand[1] == ":cash" or SplitCommand[1] == ":Cash" then
				local TargetedPlayer = SplitCommand[2]
				local CashAmout = SplitCommand[3]
				local Name = game.Players:FindFirstChild(TargetedPlayer)
				Name.leaderstats.Cash.Value += CashAmout
				--Give Cash Player

yeah try that ----------------

Ok, before I try it out I had a question someone commented this. Could you explain why += would work and + wouldn’t?

“If you change the “+” to “+=” then it should get rid of that error.”

+= just adds the values but if u dont use += you have to do

example:

money.Value = money.Value + 15

(pretty sure)

Ahh, I remember that from class. Thanks! Also it worked, thank you!

mark it as solution then --------

Done, marked you as a solution. Thanks!