I keep getting this error:
And i dony know why, its saying my username is an unknow user. Anyone know why?
Help will be greatly appreciated!
Server:
Players = game:GetService("Players")
event = script.Parent:WaitForChild("RemoteEvent")
event.OnServerEvent:Connect(function(player, Hum, UserName)
local UserId = Players:GetUserIdFromNameAsync(UserName)
local Description = Players:GetHumanoidDescriptionFromUserId(UserId)
print("Applying description...")
Hum:ApplyDescription(Description)
end)
Client:
function SceneChanged()
local OldButtons = UsernamesFrame:GetChildren()
for i, child in ipairs(OldButtons) do
if child:IsA("TextBox") then
child:Destroy()
end
end
local Scene = Scenes["Scene" .. CurrentScene.Value]
local CharactersTable = {}
for i, Character in ipairs(Scene.Characters:GetChildren()) do
CharactersTable[i] = Character
local TextBox = ButtonTemplate:Clone()
TextBox.Name = Character.Name
TextBox.Parent = UsernamesFrame
end
for i, child in ipairs(UsernamesFrame:GetChildren()) do
if child:IsA("TextBox") then
TextBox = child
TextBox.FocusLost:Connect(function()
print("Focus lost")
if TextBox.Text ~= "" and TextBox.Text ~= " " then
event:FireServer(CharactersTable[TextBox.Name], TextBox.Text)
end
end)
end
end
end