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

Make a script working on a player and not on an humanoid?

Hey guys I have this script:

wait()

local id = math.random(1,1000000000)
local hum = script.Parent.Humanoid

local newHumanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(id)

hum:ApplyDescription(newHumanoidDescription)

while wait(5) do
	local id = math.random(1,1000000000)
	local hum = script.Parent.Humanoid

	local newHumanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(id)

	hum:ApplyDescription(newHumanoidDescription)
end

and i dont know how can I manage it to work on a player and not on an humanoid, ty in advance for your answers! Have a nice day.

1 answer

✓ Accepted answer

Hi!

Sadly, you cant apply a HumanoidDescription to a Player. It only works on Humanoid.

Heres my idea: First of all, we need a player. I got our player with :PlayerAdded. Now we can apply it to them by getting the character and modifying the humanoid. You could do something like this:

game.Players.PlayerAdded:Connect(function(player)
	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:FindFirstChild("Humanoid")
	
	while wait(5) do
		local id = math.random(1,1000000000)
		local newHumanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(id)

		humanoid:ApplyDescription(newHumanoidDescription)
	end
end)

This happens for EVERY player in the server

Please note that i have checked if the scripts above are working as intended.

2 comments

0

OMG IT WORK TYSM

0

:)

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