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)
How do i make a gui that changes an NPC's appearance?
1 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
TYYY TYYY TYYY TYYYYYYYYYYY
youre welcome :]
Do you have discord? i need to show you something..
no i dont sorry
How do i set it up?
This would be a local script that is in your textbox
It didnt work :C
okay hold on let me rewrite the script
Okay :D
see if that works
Where do i put a RemoteEvent?
It says " 17:34:26.506 Players.BeyondAviation.PlayerGui.Change player.Okay.LocalScript:4: attempt to index nil with 'FocusLost' - Client - LocalScript:4"
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.

1 comment
Can someone help please