I need the client to tell the server to make some parts then the client can manipulate them. I want the parts to be on the server so they replicate to other players. I use a remote function. Problem is that when returning, the parts seem to be lost.
Client Script:
BG, PlayerFolder, AnimBase, AnimWeld, ArmBase, ABWeld, LArmBase, RArmBase, LWeld, RWeld, LWeld2, RWeld2, FakeLArm, FakeLWeld,
FakeRArm, FakeRWeld =
Rep.Armmaker:InvokeServer(
HRP,Torso,Gun_Ignore,Head,ArmC0,S.ArmC1_UnAimed.Left,S.ArmC1_UnAimed.Right,LArm,RArm,S.PlayerArms,S.FakeArmTransparency,
Character,S.FakeArmColor,S.FakeArmRealBodyColor,LArm.BrickColor,RArm.BrickColor)
print(Gun_Ignore:GetDescendants())
print(BG, PlayerFolder, AnimBase, AnimWeld, ArmBase, ABWeld, LArmBase, RArmBase, LWeld, RWeld, LWeld2, RWeld2, FakeLArm, FakeLWeld,
FakeRArm, FakeRWeld)
Server Script:
Rep.Armmaker.OnServerInvoke = function(Player,HRP,Torso,Gun_Ignore,Head,ArmC0,SArmC1_UnAimedLeft,SArmC1_UnAimedRight,LArm,RArm,
SPlayerArms,SFakeArmTransparency,Character,SFakeArmColor,SFakeArmRealBodyColor,LArmBrickColor,RArmBrickColor)
--... Make parts ...
print(BG, PlayerFolder, AnimBase, AnimWeld, ArmBase, ABWeld, LArmBase, RArmBase, LWeld, RWeld, LWeld2, RWeld2, FakeLArm, FakeLWeld, FakeRArm, FakeRWeld)
return BG, PlayerFolder, AnimBase, AnimWeld, ArmBase, ABWeld, LArmBase, RArmBase, LWeld, RWeld, LWeld2, RWeld2, FakeLArm, FakeLWeld, FakeRArm, FakeRWeld
end
It is worth noting that the client does receive the parts from the remote function if there are two task.wait() s at the end of the server script
Rep.Armmaker.OnServerInvoke = function(Player,HRP,Torso,Gun_Ignore,Head,ArmC0,SArmC1_UnAimedLeft,SArmC1_UnAimedRight,LArm,RArm,
SPlayerArms,SFakeArmTransparency,Character,SFakeArmColor,SFakeArmRealBodyColor,LArmBrickColor,RArmBrickColor)
--... Make parts ...
print(BG, PlayerFolder, AnimBase, AnimWeld, ArmBase, ABWeld, LArmBase, RArmBase, LWeld, RWeld, LWeld2, RWeld2, FakeLArm, FakeLWeld, FakeRArm, FakeRWeld)
task.wait()
task.wait()
return BG, PlayerFolder, AnimBase, AnimWeld, ArmBase, ABWeld, LArmBase, RArmBase, LWeld, RWeld, LWeld2, RWeld2, FakeLArm, FakeLWeld, FakeRArm, FakeRWeld
end
Does anyone know why this happens?
As you can see in the image, the client can see AnimBase, but AnimBase
is set to nil by the remote event. I thought it might have something to do with replication time, but that can not be true as, even without the two waits, the client does see the parts.
Am I forced to index the parts on the client rather than through the remote function? I would still have to use a remote function to make the client script yield for the parts being made.