Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Komas19 34
3 years ago
Edited 3 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 !")

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)
0
I fixed it myself, i just had to press the Apply Edits button at SCRIPT MENU and it fixed the problem Komas19 34 — 3y

1 answer

Log in to vote
0
Answered by
Komas19 34
3 years ago
Edited 3 years ago

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)

Ad

Answer this question