So I am trying to make a GUI script where on join you get a GUI, in order to Click the Button to let the GUI disappear you need to have permission. But I think I am doing something wrong in my script.(LocalScript) Can anyone take a look into my script and see what is wrong?
gui = script.Parent
Button = gui.TextButton
BigText = gui.BigText
Note = gui.Note
NoAcces = gui.NoAccess
gui.Visible = true
gui.NoAccess.Visible = false
Access = {["maup12345"] = true,["TristyOfficial"] = true}
function OnClicked()
if Access["maup12345"] == true and Access["TristyOfficial"] == true then
gui.Visible = false
elseif Access["maup12345"] == false and Access["TristyOfficial"] == false then
gui.Visible = true
gui.NoAccess.Visible = true
wait(3)
gui.NoAccess.Visible = false
end
end
script.Parent.TextButton.MouseButton1Click:Connect(OnClicked)

2 comments
Use the Kick function of the player
do you chex said, ex. game.Players.LocalPlayer:Kick()