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)
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)
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:
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
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)
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!
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
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)
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