Remote function not invoking server - yields function

first time using remote fucntion, Idk what am doing wrong

client script =

local function CreateNewCharacter(RequestedCharacter)
	print("a")
	local RequestedCharacterInstance = InstallCharacter:InvokeServer(Players:GetUserIdFromNameAsync(RequestedCharacter))
	print("a2")
end

“a2” doesnt print

calling it here -

PlayRecording(Video[1], CreateNewCharacter("aeroactual"), NPCTest)

server script=

local InstallCharacter = game.ReplicatedStorage.InstallCharacter

local function InstallCharacterFunction(Player, IDofUser)
	print("a")
	local DummyClone = game.ReplicatedStorage.Dummy:Clone()
	DummyClone.Humanoid:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(IDofUser))
end
InstallCharacter.OnServerInvoke = InstallCharacterFunction

“a” doesnt print

Pretty sure you need to return something via return

1 Like

Where are the scripts located? Also, you need to return your value from the server-sided callback. You should also be calling GetUserIdFromNameAsync from the server

1 Like
local function InstallCharacterFunction(Player, RequestedCharacterUser)
	print("a")
	local DummyClone = game.ReplicatedStorage.Dummy:Clone() ; local UserId = game.Players:GetUserIdFromNameAsync(RequestedCharacterUser)
	DummyClone.Humanoid:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(UserId))
	return true
end

still Same result, yields function and doesnt invoke
the local script is a StarterCharacterScript, the remoteFunction and serverscript is in replicatedStorage

i moved the server Script to serverscriptservice and its invoking it now
Thx guys

Yeah regular scripts don’t run in ReplicatedStorage

1 Like

oh i didnt know, Ty
fgdgh thth

If you’re not going to use the return value on the client, then you might as well use a RemoteEvent

im trying to return the instance but another problem
this is erroring

local InstallCharacter = game.ReplicatedStorage.InstallCharacter
local Players = game:GetService("Players")

local function InstallCharacterFunction(Player, RequestedCharacterUser)
	print("a")
	local DummyClone = game.ReplicatedStorage.Dummy:Clone()
	local UserId = Players:GetUserIdFromNameAsync(RequestedCharacterUser)
	local Appearnce = Players:GetHumanoidDescriptionFromUserId(UserId)
	print(Appearnce, UserId)
	DummyClone.Humanoid:ApplyDescription(Appearnce)
	return DummyClone
end

InstallCharacter.OnServerInvoke = InstallCharacterFunction
  00:48:17.183  HumanoidDescription 214360795-  Server - ServerUtility:9
  00:48:17.217  Humanoid::ApplyDescription() DataModel was not available  -  Client - NPCClientHandler:35

nevermind Had to parent the dummy

Correct. That error is raised when the Humanoid instance you apply the description to is not currently a descendant of the data-model (game). This circumstance can also cause other API members to fail, such as Animator:LoadAnimation

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.