Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Checking if a character has loaded in Round Script?

I have a big problem with my Round Script

I need to wait until the character loads to teleport them right away

This is a server side script and I need to somehow find out a way to see if their Humanoid has loaded in

I thought of adding a intermission timer to have the characters wait but I was wondering if a exploiter can maybe like make the character load extremely slow so that my round script becomes messed up and they break my game.

How would I check if a character has loaded in my game

This is a while true do loop Round Script

1 comment

0

You can't delay your loading. The server loads your character, not the player.

1 answer

Try this, currently untested since my character loaded almost instantly

function checkifallhasloaded()
	local results = {}
	for i,v in pairs(game.Players:GetPlayers()) do
		if v:HasAppearanceLoaded() then
			table.insert(results,i,true)
		else
			table.insert(results,i,false)
		end
	end
	local hey = 0
	for i,v in pairs(results) do
		if v == true then
			hey = hey + 1
		end
	end
	if hey == #game.Players:GetPlayers() then
		return "ok"
	else
		return "notok"
	end
end

repeat
	wait()
	print("waiting")
until checkifallhasloaded() =="ok"
print('ok')

3 comments

0

Simply checks if all player's appearance has loaded, if so it records whether its true/false into a table of results, which will be checked if all are true

0

Or you could just WaitForChild("Humanoid") for each player in a for i,v in pairs(game.Players:GetPlayers()) loop

0

Yea this is much simpler. Just use :WaitForChild()

This discussion is preserved as it was. New answers, comments, and votes are closed.