Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[EDIT] Why is my AntiCheat not working? Seems to give a very sus Error

Asked by 4 years ago
Edited 4 years ago

Why Is my Code not working? This fires an remote event:

while wait(0.05) do
    local Char = script.Parent
    local Speed = Char.Humanoid.WalkSpeed
    local Tbl = {}
    table.insert(Tbl, Char.Name)
    table.insert(Tbl, Speed)
    game.ReplicatedStorage.AntiCheatLab:FireServer(Tbl)
end

And this is the Code that recieves it:

local Replicate = game.ReplicatedStorage.AntiCheatLab
Replicate.OnServerEvent:Connect(function(table1)
    local charName = table1[1] -- Error is here, line 3
    local speedVal = table1[2]
    local PlLoad = game.Players:WaitForChild(charName) 
    local ChLoad = game.Workspace:WaitForChild(charName)
    local CharObj = game.Workspace:WaitForChild(charName)
    if CharObj.Humanoid.WalkSpeed ~= speedVal then
        game.Players[charName]:Kick("===")
    end
end)

Error 1 is not a valid member of Player "Players.Ferrarimami"  -  Server  -  Script:3

0
Can you show us the error? lightifieds 40 — 4y
0
You fired Tbl, so shouldnt it be Tbl instead of Table1? Nozazxe 107 — 4y

1 answer

Log in to vote
0
Answered by
Nozazxe 107
4 years ago

I think i know why, In your first script you fired Tbl, and in your second script you recieved Table1. Yet you did not fire that. Try switching it to Tbl. example:

Replicate.OnServerEvent:Connect(function(tbl)
0
Still not working. Ferrarimami 120 — 4y
0
Show me your error, including errors is crucial! I was really confused on most of this cause you didn’t specify a lot and it would be helpful if you did Nozazxe 107 — 4y
0
Show me your error, including errors is crucial! I was really confused on most of this cause you didn’t specify a lot and it would be helpful if you did Nozazxe 107 — 4y
0
where are your scripts btw Nozazxe 107 — 4y
Ad

Answer this question