So, Im FURIOUS right now. I constantly run into problems with scripting, But this one i cant fix within even 5 FULL HOURS!!!! I made a kick system for my myth game, here But its not kicking players! How does this work you ask?
There is a list called "Aproved Players" and a variable called Owner. The variable is set to a string value withing the script. I did do:
owner = script.Owner.Value aproved_players = { owner }
So it will let me in the game. BUT when i change owner to another name, It still lets me in! Basicly, I used this If thingy to check if a player is in the list:
game.Players.PlayerAdded:connect(function(plr) if plr.MembershipType == Enum.MembershipType.Premium or (string.find(plr.Name,aproved_players[1])) ~= nil then --Do something end)
I've been wanting more features in my game lately, And i WANTED like i loved this one. Here's the snippet:
val = script.OnJoinKick.Wait.Value val1 = val owner = script.Owner.Value print(owner) aproved_players = {"Equinsox","hasanchik"} banned_players = {"KonekoKittenWasTaken"} owneringame = false gameclosed = script.GameClosed.Value print(val1) game.Players.PlayerAdded:connect(function(plr) local function KickWay() print("Identified As UNKNOWN") if (string.find(plr.Name, banned_players[1])) == nil then if gameclosed == false then if plr.Character ~= nil then plr.Character:Destroy() end gui = script.OnJoinKick:Clone() gui.Parent = plr.PlayerGui wait(5) gui.Frame.Brighten.Disabled = false wait(val1) if owneringame == true then plr:Kick(plr.Name.." Is a follower of "..owner..".") elseif owneringame == false then plr:Kick(plr.Name.." Is not aproved.") end else plr:Kick("You do not have permission to join this game. (Game closed.)") end else plr:Kick("Banned.") end end if not plr then return end if plr.name == owner then owneringame = true end print("Player Joined") if plr.MembershipType == Enum.MembershipType.Premium or (string.find(plr.Name, aproved_players[1])) ~= nil then print("Identified As "..plr.name) else KickWay() end end) game.Players.PlayerRemoving:connect(function(plr) if plr.Name == owner then owneringame = false end end) game:GetService('Players').PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() plr:Kick(" ") gui2 = script.BlackOut:Clone() gui2.Parent = plr.PlayerGui end) end) end) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- hif = script.HideInterface:Clone() hif.Parent = game.StarterPlayer.StarterPlayerScripts hif.Disabled = false game.Players.PlayerAdded:connect(function(plr) local mouse = script.Mouse:Clone() mouse.Parent = plr.PlayerGui mouse.Disabled = false local fp = script.FirstPerson:Clone() fp.Parent = plr.PlayerGui fp.Disabled = false local sbifp = script.ShowBodyInFirstPerson:Clone() sbifp.Parent = plr.PlayerGui sbifp.Disabled = false local dc = script.DeviceController:Clone() dc.Parent = plr.PlayerGui dc.Disabled = false end) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- game.Players.PlayerAdded:connect(function(plr) wait(4) hum = plr.Character:FindFirstChild("Humanoid") hum.WalkSpeed = 9 end) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I have already made a whitelist system for one guy that supports names and ids, here it is:
local Whitelist = {Id = 111111111,Name = "Player",Name = "Player2"} local function kick(Player) Player:Kick("Not whitelisted") end game.Players.PlayerAdded:Connect(function(Player) for i,v in pairs(Whitelist) do if i == "Id" then if Player.UserId == v then kick(Player) end elseif i == "Name" then if Player.Name == v then kick(Player) end end end end)
If you have any questions or this doesn't solve your problem ask me!