Skip to main content

anonymousRadio

Download the raw anonymousRadio.ser file Uses: SetDisplayName · Joined · OnEvent

Complete script

anonymousRadio.ser
# Disabled by default: remove # from the filename to enable this script.
# this script makes the name into "???" when talking on the radio
# in order to anonymize the speaker

!-- OnEvent Joined
-- require @evPlayer

forever
wait_until {@evPlayer -> isTransmitting} is true

# save last display name before changing
$lastDisplayName = @evPlayer -> displayName

# anonymize the player
SetDisplayName @evPlayer "???"

wait_until {@evPlayer -> isTransmitting} is false

# if the last display name is the exact same as the name,
# then reset the display name for the same effect
# else set the last display name back
if $lastDisplayName is {@evPlayer -> name}
SetDisplayName @evPlayer _
else
SetDisplayName @evPlayer $lastDisplayName
end
end

This file is compiled during the SER build and is safe to use as a current-syntax learning example.