For one thing, you should not place an alias inside the ON TEXT handler. An alias is like a subroutine that you can call from multiple places, rather than repeating the code each time you need the result. The randuser alias is expecting $1 to be something like "notme" "other" "list" etc, but instead it's the 1st word of the text message, which I assume is !slap.

You need to move the alias outside the ON TEXT event, like how the flood_counter and repeat_counter aliases I once made for you, then inside the ON TEXT you use $randuser($2) (assuming that LIST OTHER etc is the 2nd word of the text message)

I still can't tell from your event handler what's supposed to be done with the results of $randuser when someone does type the keyword. It "return" the string instead of messaging it to channel.

Your randuser alias makes several assumptions, and will give unexpected results if those guesses are wrong.

It assumes %activetime is defined as a global variable, yet doesn't define it before using it.
It assumes %mychan is defined as a global variable, yet doesn't define it before using it.
It assumes %activelist does not exist as a global variable, so if it does exist, that string is included in the output.
Next to where you initialize %x as 1, you need to initialize %activelist as empty with:
var %activelist

It assumes that a hashtable named activeusers exists, and that it contains a list of items named after a bunch of nicks, and the data attached to those items is some kind of active time value.

The 'slapped' message is supposed to display %nick, which is only altered if there's at least 1 item in that hashtable, so since it's $null, that indicates your hashtable doesn't exist.

Your alias does not clear %nick before defining it, so if the hashtable does not exist, but %nick already exists as a global variable, the displayed message would have shown the same contents of the global variable each time.

Either you didn't paste everything you got from "a website", didn't grab everything you should have, or "a website" needs to give a refund.