I made a script that kick the player when there is a bug ingame but the kick reason is not full why?
Asked by
4 years ago Edited 4 years ago
This question has been solved by the original poster.
Please help (at the kick reason it only show "You are not authorized to join the game !")
01 | local player = game.Players |
02 | local Play = script.Parent:WaitForChild( "Play" ) |
03 | local PlayScreen = Play:WaitForChild( "PlayScreen" ) |
04 | local PlayButton = PlayScreen.PlayButton.TextButton |
05 | local LocalPlayer = player.LocalPlayer |
06 | local reason = "Points System not working !" |
08 | PlayButton.MouseButton 1 Click:Connect( function () |
09 | print ( "Player " ..LocalPlayer.Name.. " has joined" ) |
10 | if script.Value.Value = = true then |
11 | print ( "Authorized to join game" ) |
13 | LocalPlayer:Kick( "You are not authorized to join the game ! Reason : " ..reason.. " Sorry about that, the game will be back soon !" ) |
14 | print ( "Not authorized to join game" ) |
16 | PlayScreen:TweenPosition(UDim 2. new(- 1 , 0 , 0 , 0 )) |
19 | print ( "PlayScreen Deleted !" ) |
21 | if Play:FindFirstChild( "PlayScreen" ) then |
22 | print ( "Error while deleting PlayScreen kicking player..." ) |
24 | player.LocalPlayer:Kick( "Error while Deleting PlayScreen please rejoin" ) |
26 | print ( "No error came while deleting PlayScreen ! Enjoy playing !" ) |