Attempt to concatenate string with nil

Im trying to send over a Enemy (a basic humanoid model) through a remote event.
https://gyazo.com/f6249e43bf57d5e574ff1533d179bbd1
https://gyazo.com/719a2ca23bb18284b8b87560af3c55f3

And it keeps giving me this error.
https://gyazo.com/d55d407dd781fd2f7ed7e8406522b8a1

The Enemy is both on Server and Client side. Server can read it and print its name, but local one is just nil? I dont understand!

‘hit’ is the part (a arm or anything)

Please help me if you know what im doing wrong!

you might be able to fix it like this:

print("Server: ", hit.Parent.Name)
print("Local: ", Enemy)

Instead of Concatenating with .. , Just use a Comma

This usually worked for me when i tried to print a table.

Now it says attempted to index nil with name
https://gyazo.com/22df2be6b5d61f49681588bd2d750a94

It’s because .OnClientEvent doesn’t provide a Player as the first arguement (.OnServerEvent does though), you should have this instead:

Connection2 = game.ReplicatedStorage.Spells.OrbOfDestructionEnemy.OnClientEvent:Connect(function(Enemy)

After Looking back at your script, it appears that it cant find the name of the hit, thats why you are getting that error

Oh my god I am so stupid! Thank you!
Ive been up all night working on the game im just too tired…

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