So I’m trying to make it so when you click play, it takes the user ID of the one the player pastes into a textbox and loads the player’s avatar onto the rig. But it’s throwing this error:
Players.toyJig.PlayerGui.ScreenGui.TextButton.LocalScript:28: attempt to call a boolean value
Here’s the script
pcall(function(success,result)
local hd = game.Players:GetHumanoidDescriptionFromUserId(script.Parent.Parent.ManUserID.TextButton_Roundify_12px.TextBox.Text)
print(script.Parent.Parent.ManUserID.TextButton_Roundify_12px.TextBox.Text)
game.Workspace.User1.Humanoid:ApplyDescription(hd)
hd = game.Players:GetHumanoidDescriptionFromUserId(script.Parent.Parent.WomanUserID.TextButton_Roundify_12px.TextBox.Text)
game.Workspace.User2.Humanoid:ApplyDescription(hd)
end)()
Help is appreciated!
Also, this is in a LocalScript
Here’s the fixed version with some added elements:
local success, result = pcall(function(success,result)
local hd = game.Players:GetHumanoidDescriptionFromUserId(script.Parent.Parent.ManUserID.TextButton_Roundify_12px.TextBox.Text)
print(script.Parent.Parent.ManUserID.TextButton_Roundify_12px.TextBox.Text)
game.Workspace.User1.Humanoid:ApplyDescription(hd)
hd = game.Players:GetHumanoidDescriptionFromUserId(script.Parent.Parent.WomanUserID.TextButton_Roundify_12px.TextBox.Text)
game.Workspace.User2.Humanoid:ApplyDescription(hd)
end)
pcall() automaticly calls the function you pass it. pcall() also returns a bool depending on if the function successfully ran or not. So essentially, you were trying to call a bool value like it was a function.
Hopefully everything inside the pcall works as intended.