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

How do I make a npc killer take a players skin?

Asked by 2 years ago

Anyone know how I can do a thing where whenever a npc killers kills a player it then looks like that player?

0
Like the one in Aperiophobia anormalminer 9 — 2y
0
i have heard people talk about Apeirophobia if theres a killer in it that looks like a player when it kills that player then yes like the one in Apeirophobia Zack_Atro 0 — 2y
0
Maybe check which player did NPC kill, then find all clothing class in that player's character and destroy clothing in npc and replace it with ones from player Sabailuridze 126 — 2y

1 answer

Log in to vote
0
Answered by
MattVSNNL 620 Moderation Voter
2 years ago

Hello,

Assuming you already have some sort of AI just put this in your model/npc and it should work

local PlayersService = game:GetService("Players")

script.Parent:FindFirstChild("Humanoid").Touched:Connect(function(hit)
    if hit and hit.Parent:FindFirstChild("Humanoid") and PlayersService:GetPlayerFromCharacter(hit.Parent) then

        local player = PlayersService:GetPlayerFromCharacter(hit.Parent)
        local userId = player.UserId

        local description = PlayersService:GetHumanoidDescriptionFromUserId(userId)

        script.Parent:FindFirstChild("Humanoid"):ApplyDescription(description)

    end
end)
Ad

Answer this question