So I am making a kick script and I use game.Players:FindFirstChild() to find the player instance and I even had it print the classname of player and it comes out as a player instance. So why is it saying it's a string value?
game.ReplicatedStorage.Remotes.Kick.OnServerEvent:Connect(function(plr, plrToKick, msg)
if plr:GetRankInGroup(2596382) >= 254 then
local player = game.Players:FindFirstChild(plrToKick)
print(player.ClassName)
if player then
player:Kick("You have been kicked by the admin "..plr.Name". Message from admin: "..msg)
end
end)
Error: 14:09:46.499 - ServerScriptService.Kick:9: attempt to call a string value

2 comments
Oml thanks
Np.