Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to find if character gets inserted to Workspace?

I would like to create a server script which would detect whenever a player spawns and its character is inserted into Workspace, however without knowing the object player.

Something like:

game.Workspace.CharacterAdded:connect(function(character)
	--Do some complex stuff
end)

First off, is it possible to have the Workspace detect the spawning of a player without knowing the player?

2 comments

0

The "CharacterAdded" event is used ONLY for the Player; you'd have to do it as "Player.CharacterAdded"~rest; it's not an event for the Workspace.

0

Although, to answer your question, it will fire whenever the player's character spawns.

1 answer

game.Players.LocalPlayer.CharacterAdded:connect(function(character)
    --Do some complex stuff
end)
--for local script

This discussion is preserved as it was. New answers, comments, and votes are closed.