I need help with command string

Hello! I need some help. I am trying to add to the Value using a Command I have made, but I’m struggling with actually adding the Value! Thanks, AridOats.

Code Sample:

if msg:sub(1, 8) == "!addminutes " then
	local playergettingmins = game.Players:FindFirstChild(msg:sub(9))
	if playergettingmins then
		playergettingmins.leaderstats.Minutes.Value = + 1
end
1 Like

This will never be true because the first eight characters of the string will never be eleven characters long.

4 Likes

The command will not work because "!addminutes " is not 8 characters long.

Also, you are missing an end to close the 2nd if statement.

You are also adding to the value wrong, you are supposed to do ...Minutes.Value += 1. @4545killer

1 Like

Thank you, sorry for my terrible counting. It’s been a while staring at code! :sweat_smile: :flushed:
And yes, that Adding Value is the main thing I wanted! Cheers. Have my solution for… giving me the Solution!

2 Likes