Hello all,
I’ve been learning to script/ create things in Roblox Studio, but some aspects have been unclear to me. I would be grateful to any who would answer these questions for me!
WaitForChild vs FindFirstChild vs Dot
when finding/ referencing things in Roblox studio, I’ve noticed several ways to do it. Take these seperate scripts for example.
local part = game.Workspace:WaitForChild(‘Part1’)
part.BrickColor = BrickColor.new(1, 0, 0)
local part = game.Workspace:FindFirstChild(‘Part1’)
part.BrickColor = BrickColor.new(1, 0, 0)
local part = game.Workspace.Part1
part.BrickColor = BrickColor.new(1, 0, 0)
Though different, these scripts all create the desired effect:
What is the difference between using FindFirstChild, Wait for Child, and a dot?
Naming Issues
Quite simply, whenever I use studio, at the top left of my screen, I sometimes see the name of the game, sometimes a place number. Why is this?
And finally, what is the point of putting parentheses () after an if statement to disclose a condition?
if (datastore:GetAsync(initKey) == nil or debugMode == true) then
instead of
if player then
Thank you in advance