Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you detect if a players character is fully loaded?

Asked by 4 years ago
Edited by Ziffixture 4 years ago

This is the LocalScript used:

01local player = game.Players.LocalPlayer
02local HumanoidRootPart = player:FindFirstChild("HumanoidRootPart")
03 
04game.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
12end)

Please forgive me if I have made a lot of errors, I started scripting last month.

0
Can i ask u how u posted lua code like this? Niki4_best 0 — 4y
0
you press the lua sybol then paste the code inside the area Nifemiplayz 32 — 4y
0
They're talking about your indentation... Ziffixture 6913 — 4y
0
I press tab Nifemiplayz 32 — 4y
0
dude.. seriously? PlayerAdded exists NoArtificalSweetner 3 — 4y

4 answers

Log in to vote
1
Answered by 4 years ago

@everyone I have found an easier method like so:(This script was entirely made by myself)

01--Start by defining variables
02local ContentProvider = game:GetService("ContentProvider")
03local WholeGame = game:GetChildren()
04local MainFrame = script.Parent
05local textLabel = MainFrame.TextLabel
06 
07ContentProvider:PreloadASync(WholeGame)-- When game gets all of its children
08 
09 
10textLabel.Text = "Loaded!!"
11wait(2)
12MainFrame:TweenPosition(blah blah blah)
13 
14--Done
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
But doesnt that mean that the spawn has to be the exact position and shape of the humanoid root part Nifemiplayz 32 — 4y
0
Yeah, Try to test it, then go to the spectator mode (Servermode) and select the humanoid root part, find the position of it using its properties and you should be able to implement that in the script haiderISthePRO 44 — 4y
Log in to vote
0
Answered by
Nckripted 580 Moderation Voter
4 years ago

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:

1randomPlayer.CharacterAdded:Connect(function()
2 
3end)

Now, if you wanted to use this event only once, you could do the following:

1local 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.

Log in to vote
0
Answered by 4 years ago
01-- Services
02 
03local Players = game:GetService('Players') -- Gains access to the Players Service
04 
05-- Functions
06 
07local 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)
11end
12 
13-- Misc
14 
15Players.PlayerAdded:Connect(OnPlayerAdded)
0
hope this helps DevScripting 92 — 4y

Answer this question