I am a real noob at scripting I tried to run this script and it kicks the user if they are not allowed (which is what its supposed to do) but it doesn't kick the user whose name I put in.
repeat wait() until game.Players.LocalPlayer
local plr = game.Players.LocalPlayer
local name = script.Parent.Parent:WaitForChild("Name").Text
local unfilteredreason = script.Parent.Parent:WaitForChild("Reason").Text
local mod = script.Parent.Parent:WaitForChild("Mod").Text
script.Parent.MouseButton1Click:connect(function()
if plr:GetRankInGroup(2823155) == 255 or plr:GetRankInGroup(2823155) > 251 or plr.Name == "Player1" then
for _,v in pairs(game.Players:GetChildren()) do
if v.Name == name then
local reason = game:GetService("Chat"):FilterStringForBroadcast(unfilteredreason,plr)
v:Kick(reason)
end
end
else
plr:Kick("Why are you here??")
end
end)
it gives me no error in the log also i dont know why "game:GetService("Chat"):FilterStringForBroadcast(unfilteredreason,plr)" is not formatting correctly it is correct in the script

1 comment
thank you! it worked :))