I’m trying to make a command to give a certain player a certain amount of in-game currency. However, this command isn’t working. Here’s the command:
commands.givesnowballs = function(sender, arguments)
if sender:GetRankInGroup(11635716) >= 254 then
print("player has rank")
local playerName = arguments[1]
local player = findPlayer(playerName)
if player then
local guiStats = player:WaitForChild("guiStats")
local balance = guiStats:WaitForChild("Snowballs")
local snowballs = tonumber(arguments[2])
balance = balance.Value + snowballs
print("snowballs given")
else
print("player not found")
end
else
print("player not high enough rank")
end
end
The confusing thing is that it prints “snowballs given”, but it doesn’t give the snowballs. There are no errors in the output. How do I fix this?