I was trying to make an admin commands script but i " ')' expeted (to close '(' at line 21) near a bit of the script:
--//Checks if the player is banned or not
if Player.PlayerValues.IsBanned.Value == true then
Player:Kick("You're Banned From This Game.") --//Reason for kick
end
end)
Player.Chatted:connect(function(message)
for i, AdminName in ipairs(Admins) do
if Player.Name == AdminName then
--//Commands\\--
--//Kill Command
if message:sub(1, 6) == "/kill " then
local TargetPlayer = game.Players:FindFirstChild(message:sub(7))
if TargetPlayer then
local Character = TargetPlayer.Character
if Character then
Character.Humanoid.Health = 0
end
end
end
i also tryed to add
repeat wait() until error == nil
near the error but osent work

7 comments
lol
forgot to mention the line 21 is the fifth one
error is a function, not a value
whole script plz :>
https://pastebin.com/LhN6dSzM there
If you indented properly, you'd spot easily that there are two extra 'end's after --//im cencoring this command xdd, that don't match anything, and then the second-to-last 'end' in the script is missing the ) to close the Player.Chatted anonymous function.
Works! BUT now i have problem with line 8 :( "Expected end to close function"