I am creating a message that pops up if you're blacklisted from this game. The message will not show tho. I don't know why; That's why I am asking. -duh-

LocalScript:

local Blacklist = {"suspectshot108"} -- TEST
local FriendList = {} -- People that if blacklist, can still enter game.
local Player = game.Players.LocalPlayer

-- Functions:
local Bind = Instance.new("BindableFunction",game.ReplicatedStorage)
Bind.Name = "Ignore_function"
local function CallServer(text)
	if text == "Yes" then
		for _,v in pairs(FriendList) do
			if string.match(Player.Name,v) then
				Player.Character.Humanoid.WalkSpeed = 16
			else
				Player:Kick("Server denied.")
	end
		end
	else
		if text == "No" then
			Player:Kick("I don't care either.")
		end
	end
end

Bind.OnInvoke = CallServer

game.Players.PlayerAdded:Connect(function(Plr)
	for _,v in pairs(Blacklist) do
		if string.match(Plr.Name,v) then
			game:GetService("StarterGui"):SetCore("SendNotifaction", {
			  Title = "Moderation";
			  Text = "The developers have blacklisted you from this game, try to enter?";
			  Icon = "";
			  Duration = 8;
			  Callback = Bind;
			  Button1 = "Yes";
			  Button2 = "No"; 	
			})
		end
	end
end)

3 comments

1

PlayerAdded will not fire for the client the local script is running on. do this server sided with remotes

0

u cant kick ppl on the client, only urself

0

Yes, I see that problem too. I will use remote functions.