Howdy!

I've made a huge script which bans (:KIck) players from my server if they're on the banlist.

However, if i add myself to the list. It works (it kicks me) But if i join the game with my alt-account (Which is on the banlist too), it seems not to work?

I am really sure i made no typos or anything. As the list goes by UserID and not username.

Sad thing is i can't see the output-log in-game with my alt-account...

So, this is the script:

(The script is inside PlayerGUI)

wait()
Players = game:GetService("Players")
for i, player in pairs(Players:GetPlayers()) do
Speler = player
end
local TeleportService = game:GetService("TeleportService")
BannedUserID = script.Parent.UserID.Value

BanSFX = workspace.BanMSG
BanBackGround = script.Parent.Parent.Parent.BanBackGround
BanBackGround.Visible = false
local Done = false
local placeID_1 = 5108251813
local PlaceID = game.PlaceId

local PlayerName = Speler.Name

DeReden = script.Parent.Parent[PlayerName].BanReason.Value
BanDate = script.Parent.Parent[PlayerName].Date.Value
BanNote = script.Parent.Parent[PlayerName].BanAppeal.Value
BanStat = script.Parent.Parent[PlayerName].BanStatus.Value


placeId = game.PlaceId -- https://www.roblox.com/games/862942316/pb
Asset = game:GetService("MarketplaceService"):GetProductInfo(placeId)
ServerVersion = game.PlaceVersion


function BanPlayer()
	wait()
	if Speler.UserId == BannedUserID then
		print('Player ' ..PlayerName..'Is On The BanList')
		if BanStat == true then
			print('Player '..PlayerName..' BanStatus = Positive')
			BanBackGround.Visible = true
			
			wait()
			
			warn('User '..PlayerName..' Has been kicked from "'..Asset.Name..'" | User has been kicked for "'..DeReden..'" | User has been banned since: '..BanDate..'.')
				for i=0,120,1 do
				Speler:Kick('Dear '..PlayerName..'. You have been banned since '..BanDate..' for '..DeReden..'. The owner left you a note: "'..BanNote..'". Cya!')
				TeleportService:Teleport(placeID_1, Speler)
				Speler:Destroy()
				
				wait()
				end
		else --BanStat
		end
		--
	end
	wait()
	Done = true
end

function BanMusic()
	wait()
	Done = true
	BanSFX:Play()
	local Hint = Instance.new('Message')
	Hint.Parent = script.Parent
	Hint.Text = "Dear "..PlayerName.. ". You have been banned from this game since " ..BanDate.. ". The reason you have been banned is: " ..DeReden.. ". "
	wait(100)
	Speler:Kick("Dear "..PlayerName.. ". You have been banned from this game since " ..BanDate.. ". The reason you have been banned is: " ..DeReden.. ". ")
end

repeat
	wait()
	if PlaceID == 5108251813 then
		BanMusic()
		BanSFX:Play()
	else
		BanPlayer()
	end
	wait(1)
until Done == true

1 comment

0

Honestly I can't get much information from this. Maybe double check the accounts you put into the banlist