Player not being killed LUA logic error

Hey, I am currently working on an entity but I am getting a weird bug, in singleplayer the entity is able to kill the player successfully, however when I use the entity on a server the player does not get killed, yet everything else executes as expected.

Any help will be greatly appreciated :stuck_out_tongue:

init.lua

[CODE REMOVED]

—UPDATE—
I have found out that only certain jobs are killed when running on a server, the safelisted ones, thats the exact opposite of what happens on singleplayer

Another Update: Im pretty sure ive found where the bug happens:


local plyTeam = team.GetName(vp:Team())
		print(plyTeam)
		for k, v in pairs (safelist) do
			print(v)
		if plyTeam ~= v then

This code tells the program that if the players team is not on the safelist then infect them, however the ~= is either registering as an == or not registering at all, I have not got a clue how tf to fix this. The code looks like it should work fine, but the if statement is messing up ._.

Yet Another Update: I found out what is causing the issue, the first time the safelist is checked, the players team matches, however because it is a for loop it then checks if the players team is equal to the next team, which it will not be, therefore starting the infection, ill keep updating the post when I find something out

Final Update: Fixed the issue :smiley: