for _,Attack in pairs (PlayerAttacks) do
print(Attack.TargetType)
if Attack.Target.BattleInfo.Alive.Value == false then Attack.Target = Enemies[math.random(1,#Enemies)] end
print(Attack.TargetType)
PlayerAttackScript(Attack,CharactersInBattle,Stage)
end
Is send to:
return function(Attack,AllPlrs,Stage)
local Target = Attack.Target
local Attacker = Attack.Attacker
local Attack = Attack.Attack
local TargetType = Attack.TargetType
print(Target,Attacker,Attack,TargetType)
Output:
Why doesn’t TargetType get printed out correctly in the second script?
Tried: PlayerAttackScript(Attack, Attack.TargetType ,CharactersInBattle,Stage) still prints out nil on Attack.TargetType.
Remote Events from Client to Server always returns the player instance in the argument. I’m not sure if this is the issue, but did you make sure the player is accounted in the Remote Event?
Sorry, my head is so full today that I mistyped the title. It’s actually communication between modulescripts where it somehow loses Attack.TargetType string.