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 3 years ago
Edited by Ziffixture 3 years ago

This is the LocalScript used:

local player = game.Players.LocalPlayer
local HumanoidRootPart = player:FindFirstChild("HumanoidRootPart")

game.Players.PlayerAdded:Connect(function()
    if HumanoidRootPart == true then
        print("HumanoidRootPart was detected!")
    else
        wait()
        if wait(20) then
            print("Your internet doge .-.")
    end
end)

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 — 3y
0
you press the lua sybol then paste the code inside the area Nifemiplayz 32 — 3y
0
They're talking about your indentation... Ziffixture 6913 — 3y
0
I press tab Nifemiplayz 32 — 3y
0
dude.. seriously? PlayerAdded exists NoArtificalSweetner 3 — 3y

4 answers

Log in to vote
1
Answered by 3 years ago

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

--Start by defining variables
local ContentProvider = game:GetService("ContentProvider")
local WholeGame = game:GetChildren()
local MainFrame = script.Parent
local textLabel = MainFrame.TextLabel

ContentProvider:PreloadASync(WholeGame)-- When game gets all of its children


textLabel.Text = "Loaded!!"
wait(2)
MainFrame:TweenPosition(blah blah blah)

--Done
Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 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 — 3y
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 — 3y
Log in to vote
0
Answered by
Nckripted 580 Moderation Voter
3 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:

randomPlayer.CharacterAdded:Connect(function()

end)

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

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.

Log in to vote
0
Answered by 3 years ago
-- Services

local Players = game:GetService('Players') -- Gains access to the Players Service

-- Functions

local function OnPlayerAdded(Client) -- Function that fires whenever a Player enters the Server
    Client.CharacterAppearanceLoaded:Connect(function() -- This is the function that detects when all the assets of a Player's Appearance is loaded into their Character
        print(Client.Name .. "'s Character has fully loaded.")
    end)
end

-- Misc

Players.PlayerAdded:Connect(OnPlayerAdded)
0
hope this helps DevScripting 92 — 3y

Answer this question