local model = replicatedStorage.Remotes.Events.GetClassModel:InvokeServer(selected)
print(model)
Server
function game.ReplicatedStorage.Remotes.Events.GetClassModel.OnServerInvoke(player, class)
local armour = game.ReplicatedStorage.Classes:FindFirstChild(class):FindFirstChild('Armour')
if not armour then return end
local weapon = game.ReplicatedStorage.Classes:FindFirstChild(class):FindFirstChild('Weapon')
if not weapon then return end
local armourClone = armour:Clone()
armourClone.Name = 'ArmourClone'
local weaponClone = weapon:Clone()
weaponClone.Name = 'WeaponClone'
local character = armourClone
local humanoid = character.Humanoid
humanoid:EquipTool(weaponClone)
return armourClone
end
If I print (armourClone) in the Server, it prints ArmourClone, but it isn’t being passed through to the client?
Instances parented to nil will not replicate from server to client. Try parenting armourClone to ReplicatedStorage from the server and see what happens.
While this is not an answer to your question why are you doing this? game.ReplicatedStorage.Classes:FindFirstChild(class):FindFirstChild('Armour')
You do not check if :FindFirstChild(class) is nil.You are assuming that :FindFirstChild(class) will always be there. Also I don’t know why you didn’t make a variable for the ReplicatedStorage in your server script. Indexing the DataModel just to get a service like that is unacceptable. It is too repetitive. D.R.Y. (Don’t repeat yourself).
Oh I forgot to mention, this is a really rough script, like really rough. It’s basically just a quick mockup to try seeing if I can get something to work, because everything else I have tried hasn’t worked. So that’s why it’s not the nicest script to look at purely just thrown together to try and get something working, and if it works I can go back and redo everything to make it clean, otherwise I can just scrap this without having to worry about spending forever making a nice script, only to have it not work
Hmmm I can’t really do that Point of this script was to hopefully get an NPC to be equipping a tool in a customisation screen, but if it’s parented to the workspace by the server then every single player can see that NPC