Pass in a variable with a cui button command?Solved
Hi, 

I need to pass in a variable with a cui button command but can't seem to get it to work. Can someone show me where i've gone wrong?

Button =
                {
                    Command = "upgrade.speed" + furnaceID.ToString(),
                    Color = "0 0.8 0 0.5"
                },


[ConsoleCommand("upgrade.speed")]
        
void UpgradeSpeed(ConsoleSystem.Arg args)
        {
            ulong furnaceid = System.Convert.ToUInt32(args.Args[0]);

            Puts(furnaceid.ToString());
            Puts("upgrade speed");
        }​
you forgot a space after command

Maybe try using string interpolation, it might help to spot and avoid these issues.

MS Docs

$"upgrade.speed {furnaceID}"
5ba216a6d7f65.png Orange
you forgot a space after command

where?

Command = "upgrade.speed!!!HERE!!!" + furnaceID.ToString(),
5ba216a6d7f65.png Orange
Command = "upgrade.speed!!!HERE!!!" + furnaceID.ToString(),

thanks, it worked

Locked automatically