Period instead of colon

  1. What do you want to achieve?

an answer

  1. What is the issue?

So i was making a random script and i accidentally pressed a period instead of a colon, nothing out of the ordinary. However, I noticed it did not turn red when i used .waitforchild() instead of :waitforchild().

Are these effectively the same thing? or is there a different function if i use a period instead of a colon as the operator.

image
image

im not sure if this is new or not, all i know is that i’ve never seen that before ( I AM NOT A SCRIPTER!!!)

image
I get this error when i run the script, but when i look for errors prior to playing the game, I see nothing. Weird. Maybe this post is a waste of time? im not sure. Any explanations?

They are effectively the same thing but one is shorthand to add an extra parameter.

workspace.Part:Destroy()

is the same as:

workspace.Part.Destroy(workspace.Part)

This page also explains it in more detail:
https://www.lua.org/pil/16.html

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.