local RocketScript = WaitForChild(script, 'Rocket') local RocketScript2 = game:WaitForChild('Rocket')
I dont understand what WaitForChild(script,'Rocket' ) means?
local RocketScript = WaitForChild(script, 'Rocket') local RocketScript2 = game:WaitForChild('Rocket')
I dont understand what WaitForChild(script,'Rocket' ) means?
the Colon, : is used to call a function on an object, this is what we usualy refer to as a method. Methods have the self parameter in them automatically, which refers to the object the method is being called upon.
This is why WaitForChild(script,"Rocket") is doing the same thing as script:WaitForChild("Rocket") as script will be self when using the Method variant.
Eg.
function Thing:Rename(Name)
self.Name = Name
end
would be the same as
function Rename(Thing,Name)
Thing.Name = Name
end
This discussion is preserved as it was. New answers, comments, and votes are closed.