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

How do i make a gui that changes an NPC's appearance?

How do i make a gui that when you type a player ID into a text box, it changes an NPC appearance to the players outfit (the player's ID you put in)

1 comment

0

Can someone help please

1 answer

✓ Accepted answer

Use Humanoid:ApplyDescription and Players:GetHumanoidDescriptionFromUserId

https://developer.roblox.com/en-us/api-reference/function/Humanoid/ApplyDescription https://developer.roblox.com/en-us/api-reference/function/Players/GetHumanoidDescriptionFromUserId

Use remote events as well

local script in textbox:

local textbox = -- your textbox
local event = -- your event

textbox.FocusLost:Connect(function() -- you put however you want to detect
	local id = tonumber(textbox.Text) -- just incase it stays a string
	event:FireServer(id)
end)

normal script in workspace or serverscriptservice:

local event - -- your event
local npc = -- your npc
local humanoid = npc:WaitForChild("Humanoid")
event.OnServerEvent:Connect(function(id)
	local description = game.Players:GetHumanoidDescriptionFromUserId(id)
	humanoid:ApplyDescription(description)
end)

hope this helps you

13 comments

0

TYYY TYYY TYYY TYYYYYYYYYYY

0

youre welcome :]

0

Do you have discord? i need to show you something..

0

no i dont sorry

0

How do i set it up?

0

This would be a local script that is in your textbox

0

It didnt work :C

0

okay hold on let me rewrite the script

0

Okay :D

0

see if that works

0

Where do i put a RemoteEvent?

0

It says "  17:34:26.506 Players.BeyondAviation.PlayerGui.Change player.Okay.LocalScript:4: attempt to index nil with 'FocusLost' - Client - LocalScript:4"

0

Put remotevent in replicated storage, and when you're specifying your text box trying using WaitForChild()

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