This is the LocalScript
used:
01 | local player = game.Players.LocalPlayer |
02 | local HumanoidRootPart = player:FindFirstChild( "HumanoidRootPart" ) |
03 |
04 | game.Players.PlayerAdded:Connect( function () |
05 | if HumanoidRootPart = = true then |
06 | print ( "HumanoidRootPart was detected!" ) |
07 | else |
08 | wait() |
09 | if wait( 20 ) then |
10 | print ( "Your internet doge .-." ) |
11 | end |
12 | end ) |
Please forgive me if I have made a lot of errors, I started scripting last month.
@everyone I have found an easier method like so:(This script was entirely made by myself)
01 | --Start by defining variables |
02 | local ContentProvider = game:GetService( "ContentProvider" ) |
03 | local WholeGame = game:GetChildren() |
04 | local MainFrame = script.Parent |
05 | local textLabel = MainFrame.TextLabel |
06 |
07 | ContentProvider:PreloadASync(WholeGame) -- When game gets all of its children |
08 |
09 |
10 | textLabel.Text = "Loaded!!" |
11 | wait( 2 ) |
12 | MainFrame:TweenPosition(blah blah blah) |
13 |
14 | --Done |
Maybe try to identify the spawn, and then find the position of the spawn location, ~~~~~~~~~~~~~~~~~ if HumanoidRootPart.Positon = YourSpawnPositonHere then print("HumanoidRootPart Detected") end ~~~~~~~~~~~~~~~~~ make sure the spawn is collision off, and try to find the position of the humanoid root part when it loads, maybe you don't have to use the spawn.
Roblox has an in-house event for this. It is called CharacterAdded, and can be used on a player. Here is an example of how this would work:
1 | randomPlayer.CharacterAdded:Connect( function () |
2 |
3 | end ) |
Now, if you wanted to use this event only once, you could do the following:
1 | local character = player.Character or player.CharacterAdded |
This would look for a character, and if there is none, the or
keyword will tell it to wait until CharacterAdded
is triggered.
01 | -- Services |
02 |
03 | local Players = game:GetService( 'Players' ) -- Gains access to the Players Service |
04 |
05 | -- Functions |
06 |
07 | local function OnPlayerAdded(Client) -- Function that fires whenever a Player enters the Server |
08 | Client.CharacterAppearanceLoaded:Connect( function () -- This is the function that detects when all the assets of a Player's Appearance is loaded into their Character |
09 | print (Client.Name .. "'s Character has fully loaded." ) |
10 | end ) |
11 | end |
12 |
13 | -- Misc |
14 |
15 | Players.PlayerAdded:Connect(OnPlayerAdded) |