Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I made a script that kick the player when there is a bug ingame but the kick reason is not full why?

Please help (at the kick reason it only show "You are not authorized to join the game !")

local player = game.Players
local Play = script.Parent:WaitForChild("Play")
local PlayScreen = Play:WaitForChild("PlayScreen")
local PlayButton = PlayScreen.PlayButton.TextButton
local LocalPlayer = player.LocalPlayer
local reason = "Points System not working !"

PlayButton.MouseButton1Click:Connect(function()
	print("Player "..LocalPlayer.Name.. " has joined")
	if script.Value.Value == true then
		print("Authorized to join game")
	else
		LocalPlayer:Kick("You are not authorized to join the game ! Reason : "..reason.." Sorry about that, the game will be back soon !")
		print("Not authorized to join game")
	end
	PlayScreen:TweenPosition(UDim2.new(-1, 0, 0, 0))
	wait(2)
	PlayScreen:Destroy()
	print("PlayScreen Deleted !")
	wait(5)
	if Play:FindFirstChild("PlayScreen") then
		print("Error while deleting PlayScreen kicking player...")
		wait(1)
		player.LocalPlayer:Kick("Error while Deleting PlayScreen please rejoin")
	else
		print("No error came while deleting PlayScreen ! Enjoy playing !")
	end
end)

1 comment

0

I fixed it myself, i just had to press the Apply Edits button at SCRIPT MENU and it fixed the problem

1 answer

I fixed it myself, i just had to press the Apply Edits button at SCRIPT MENU and it fixed the problem (I can't accept my own answer lol)

This discussion is preserved as it was. New answers, comments, and votes are closed.