I was wondering what you do when it comes to printing out stuff. Let’s say your printing a welcome message when a player joins your server. What would you print? Would you print out something boring like player joined the server or something more pretty like [Server]: {Player.DisplayName} has joined the server! ? Do you have the same printing style when it comes to printing on the server and client?
And what do you think is the best way and most effecient way for printing out stuff?
I’m looking forward for your replies!
This is more of a UI/UX style question than a programming/dev one; you might fare better in another subforum. My advice would be to just see what games you play do, and what you think looks best and go with that. It’s not really Roblox-specific, consider any games you play. How you work things like player joins will not make or break your game either way.
the only instances when i use print is when it comes to debugging, and i usually just do index printing or value printing to see what code runs and what doesn’t.
here’s an example:
local bool = false
print("1")
if bool then
print("2")
end
workspace.Baseplate.Anchored = false
print("3")
in this case, the output would only print 1 and 3, which means the if statement did not ever get run.
local Bool = false
print("Checking Bool")
if Bool then print("Bool is true") end
workspace.Baseplate.Anchored = Bool
print("Set Baseplate.Anchored to", Bool)
-- Backticks:
print(`Welcome to my game, {Player.Name}!`)
...
-- Quotes:
print("Welcome to my game,", Player.Name .."!") -- Single
print('Welcome to my game,', Player.Name ..'!') -- Double
I also use print for debugging mostly. Sometimes I’ve left prints inside of published systems that run on the server just in case some obscure bug happens and I can catch what it’s doing at the time in the console.
If I leave a print in intentionally it’s always formatted so that it’s easy to follow and as to the point as possible.