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

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

Asked by 2 years ago

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

Log in to vote
1
Answered by
Klui36 45
2 years ago
Edited 2 years ago

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.

0
OMG IT WORK TYSM wDaerkfeX 37 — 2y
0
:) Klui36 45 — 2y
Ad

Answer this question