Question on Parameters... mostly event based ones

So I am trying to wrap my head around how Event Parameters work. But this is how I understand them so far…

So let’s take:

local playerService = game:GetService("Players")

local function playerAdded(player)
	print(player.AccountAge)
end

playerService.PlayerAdded:Connect(playerAdded)

So we have PlayerAdded Event which takes in the parameter player. In the API it says that the player parameter stands for a “Player Object”.

So does that mean… the parameter of the event already knows all of the properties such as AccountAge property or another property like Character, which is the reference to a model with a humanoid as the API states… so thats why in some scripts people do if player.Character then and then they attach it to the CharacterAdded event.

So in conclusion… is that how these parameters work? If so I might have just revolutionised my way of thinking because I have been stupidly reading things.

1 Like

Yea, what you said about parameters is (I think) correct, can you give more examples on how you think it works?

1 Like

Like you know how you can do game.Players.LocalPlayer.AccountAge

Isn’t that basically the same meaning as in the Parameter but shortened.

But ofc the PlayerAdded event runs as soon as a Player joins but I’m talking about parameters here.

In the parameters section here, it says (same as you said) that the first (and only) parameter is a Player object. There is a link there, which if you click it, takes you to the page for Player objects here.
Player objects contain all of the information such as account age, character, name, :Kick(), etc.

1 Like

Yes, that is correct… do you need help with non-event based parameters?

1 Like

No that’s pretty much all I wanted to know and be reassured on. And since you and Jarod answered my question I’ll do a randomiser and give whoever which person the solution.

1 Like

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