I'm working an admin script and when I pass over "victim" it turns from "Player2" to "Player1", kicking the player registering the kick event. I've never had this issue before, it doesn't print as like "attempt to index a nil value" (already dealt with that) but the variable changes when it's passed over to the server script and I cannot figure out why.
-- Server script snip
function onKickEvent(Player,victim)
if not IsStaffMember(Player) then return Player:Kick("Stop exploiting.") end
local event = "_K"
print(victim.Name, Player.Name) -- Prints "Player1 Player1"
_M:FireClient(Player,victim,event)
game:GetService("Players")[victim.Name]:Kick("Do not break game rules. Kicked by "..Player.Name)
end
-- Local script snip
script.Parent.MouseButton1Click:Connect(function()
for i,v in pairs(Staff) do
if not Player.Name == v then return end
end
if panel.Value.Value == "a" then
local victim = game:GetService("Players"):FindFirstChild(script.Parent.Parent.box.Text)
print(victim.Name, Player.Name) -- Prints Player2 Player1
kick:FireServer(Player,victim)
end
end)
