you would just listen for player.CharacterAdded event...
local function onCharacterLoaded(character)
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(onCharacterLoaded)
end)
the above has to be in a server script btw.
if you really want the event at which the player loads into the game to be client side, then
you have one or both of the following examples to use..
In LocalScript
local function onCharacterLoaded(character)
if (player.Character) then
end
end
example 1:
local player = game.Players.LocalPlayer
player:GetPropertyChangedSignal("Character"):Connect(OnCharacterLoaded);
example 2:
1). put the a locascript in a ScreenGui object, and change screenGui.ResetOnSpawn to true
2). Parent the ScreenGui to StarterGui;
3). put the following code in the localscript:
player = game.Players.LocalPlayer
game.ReplicatedStorage.RemoteEvent:FireServer();
**please not: the 2 examples aren't as efficient as using a server to listen for these things, and I really don't recommend using them, since they aren't best practice
so use the first snip of code to do the work
**
1 comment
good answer