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.
@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
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:
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.
-- 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)