I made a anti exploit script on server sided. Everything was going well until there was one major issue. When I step first on my map it automatically kicked me out. I checked the StarterPlayer to see if the player settings are correct and they are. I checked the gears they are what they suppose to. I don’t see what’s wrong with the code maybe you do if you do, please tell me below.
Here is some of the Code:
for i,Parts in pairs(workspace.World["Parking Lot Area"][".Spawn Areas. "]:GetChildren("SpawnLocation")) do
Parts.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
local Ememy = Players:GetPlayerFromCharacter(hit.Parent)
print(Ememy)
--- Humanoid Variable ---
local Backpack = Ememy.Backpack
local Starter = Ememy.StarterGear
local Children = hit.Parent
print("Connected")
while wait() do -- Locks on a player and loops forever, until they do something illegal.
print("Looped")
Humanoid.Name = "Humanoid"
Backpack.ChildAdded:Connect(function(Ob)
print("Checked")
if Ob:IsA("HopperBin") then
Ememy:Kick("We meet again...")
end
end)
if Humanoid.WalkSpeed ~= 16 or Humanoid.JumpPower ~= 50 or #Children:GetChildren("ForceField") > 1 or #Children:GetChildren("Humanoid") ~= 1 or Humanoid.MaxHealth ~= 100 then
--print("Kicked")
Ememy:Kick("attempt to index nil")
end
end
end
end)
end