How to :ApplyDescription() without ServerScript

so I want to create player data from name, apply to humanoid
but there is an error,
Humanoid:ApplyDescription() can only be called by the backend server
how do i make it applydescription by local player, by using localscript?

local plrAva = game.Players.LocalPlayer.Character.Name
Players = game:GetService("Players")

local ID = Players:GetUserIdFromNameAsync(plrAva)
local Appearance = Players:GetHumanoidDescriptionFromUserId(ID)
  • im using local script btw
1 Like

You can send a remote event to the server, where the server will tell it to change it, otherwise you just cant ig.

1 Like

if im using remoteevent it fires to serverscript, and it applies to everyone, not by localplayer

1 Like

well then you arent doing it right I think. Can I see your code on how you sent the event to the server, and then what you did on the server?

2 Likes

local script

local plrAva = game.Players.LocalPlayer.Character.Name
local remote = game.ReplicatedStorage.RemoteEvent
print("getting plr name")
Players = game:GetService("Players")

local ID = Players:GetUserIdFromNameAsync(plrAva)
local Appearance = Players:GetHumanoidDescriptionFromUserId(ID)
print(plrAva)

remote:FireServer()

serverscriptservice script

local remote = game.ReplicatedStorage.RemoteEvent

remote.OnServerEvent:Connect(function(player)
	script.Parent.Humanoid:ApplyDescription(Appearance)
	script.Parent.Humanoid.DisplayName = plrAva

end)
1 Like
local plrAva = game.Players.LocalPlayer.Character.Name
local remote = game.ReplicatedStorage.RemoteEvent
print("getting plr name")
Players = game:GetService("Players")

local ID = Players:GetUserIdFromNameAsync(plrAva)
local Appearance = Players:GetHumanoidDescriptionFromUserId(ID)
print(plrAva)

remote:FireServer(Appearance)

include the appearance in the local script and apply it like this:

local remote = game.ReplicatedStorage.RemoteEvent

remote.OnServerEvent:Connect(function(player, Appearance)
	player.Character.Humanoid:ApplyDescription(Appearance)
	player.Character.Humanoid.DisplayName = plrAva
end)
2 Likes

Ok from the look of it your script is parented to the character, THIS ISNT WHAT YOU WANT. Parent this script to server script service, and then do this code instead:

local remote = game.ReplicatedStorage.RemoteEvent

remote.OnServerEvent:Connect(function(player, Appearance)
    local hum = player.Character.Humanoid
	hum:ApplyDescription(Appearance)
	hum.DisplayName = plrAva

end)

Now for the local script do this:

local plrAva = game.Players.LocalPlayer.Character.Name
local remote = game.ReplicatedStorage.RemoteEvent
print("getting plr name")
Players = game:GetService("Players")

local ID = Players:GetUserIdFromNameAsync(plrAva)
local Appearance = Players:GetHumanoidDescriptionFromUserId(ID)
print(plrAva)

remote:FireServer(Appearance )

What we do here is send the Appearance from the client to the server, we then get the players humanoid (Or the player who triggered the event) and make the changes to said player. We take the Appearance which again was sent from the client, and apply it to the humanoid

And @VonsRevenges beat me to it lol

3 Likes

thx guys but its giving me an error @VonsRevenges @FroDev1002
Argument 1 is invalid: expected ‘HumanoidDescription’ instance type - Server - ServerScript:4

local

local plrAva = game.Players.LocalPlayer.Character.Name
local statue = script.Parent.Humanoid  (statue is a rig, child of localscript located on scgi)
local remote = game.ReplicatedStorage.RemoteEvent
print("getting plr name")
Players = game:GetService("Players")

local ID = Players:GetUserIdFromNameAsync(plrAva)
local Appearance = Players:GetHumanoidDescriptionFromUserId(ID)

remote:FireServer(statue ,Appearance)

server script

local remote = game.ReplicatedStorage.RemoteEvent

remote.OnServerEvent:Connect(function(statue, Appearance)
	statue.Character.Humanoid:ApplyDescription(Appearance)
end)
1 Like

Where is the plrAva exists in the local script?

ok, when you fire server, you dont need to pass the player, it automatically does that for you

local plrAva = game.Players.LocalPlayer.Character.Name
local statue = script.Parent.Humanoid  (statue is a rig, child of localscript located on scgi)
local remote = game.ReplicatedStorage.RemoteEvent
print("getting plr name")
Players = game:GetService("Players")

local ID = Players:GetUserIdFromNameAsync(plrAva)
local Appearance = Players:GetHumanoidDescriptionFromUserId(ID)

remote:FireServer(Appearance) -- No need to send the player! Remote events when fired to the server automatically send the player with it!
1 Like

You can use applydescription on the client, but the target character must only exist on the client. Clone whatever character you’re trying to apply the description to (on the client) and use ApplyDescription on its humanoid

1 Like

plrava is the local player var

1 Like

The first argument of OnServerEvent should always be Player.

local remote = game.ReplicatedStorage.RemoteEvent

remote.OnServerEvent:Connect(function(player, statue, Appearance)
	statue.Character.Humanoid:ApplyDescription(Appearance)
end)

Try this code and see if it works.

local plrAva = game.Players.LocalPlayer.Character.Name

Also you can just do game.Players.LocalPlayer.Name. The character isn’t necessary here, but it won’t parse an error.

1 Like

i did and it still gave me error
Argument 1 missing or nil - Server - SScript:4

local remote = game.ReplicatedStorage.RemoteEvent

remote.OnServerEvent:Connect(function(player,rig, Appearance)
	rig.Humanoid:ApplyDescription(Appearance)
end)
1 Like

Another issue.

local:

local plr = game.Players.LocalPlayer
local statue = script.Parent.Humanoid  (statue is a rig, child of localscript located on scgi)
local remote = game.ReplicatedStorage.RemoteEvent
print("getting plr name")
local Players = game:GetService("Players")

local ID = Players:GetUserIdFromNameAsync(plr.Name)
local Appearance = Players:GetHumanoidDescriptionFromUserId(ID)

remote:FireServer(Appearance)

server:

local remote = game.ReplicatedStorage.RemoteEvent

remote.OnServerEvent:Connect(function(statue, Appearance)
	statue.Character.Humanoid:ApplyDescription(Appearance)
end)

You only need to fire the appearance.

1 Like

What about sending a remoteevent to a serverscript, and that server script would create
a rig in replicatedstorage with the appearance of the player you would want and then communicate with the client once its done. (communicating to the client is optional)

After the rig with the appearance of the player you want is created in replicatedstorage,
the client would clone its accessories, skin tone, and clothes and parent it to the targetted rig

1 Like
statue.Character.Humanoid:ApplyDescription(Appearance)

Argument 1 missing or nil - Server - sScript:4

1 Like