17:38:46.671 - Unable to cast value to Object
My worst enemy, right there. The problem is, that no matter what I do to the invokeclient, it either returns nil, or that error.
game.Players[script.Parent.Parent.Parent.Name].PlayerGui.mainGame['no hackie 4 u']:InvokeClient(nil, tonumber(otherPart.Value.Value))
What makes it return nil, you say?
script.GiveMoney.OnClientInvoke = function(player, amount)
if not amount then print'nil' return nil end
print(amount)
game:GetService('ReplicatedStorage').Remotes.addMoney:InvokeServer(tostring(of.GetHash()), tonumber(amount))
end
For some reason, amount is nil, even though it's CLEARLY there. (otherPart.Value.Value)
Don't worry about otherPart. The value provided is 1.
If I were to do :InvokeClient(tonumber(otherPart.Value.Value), it would return the error above.
Any ideas?

1 comment
greatest of all time