am tryin to make a login screen so when you input wrong password it kicks you off of the game. what i have done so far in localscript.
local code = script.Parent.Parent.Code local textbox = script.Parent.Parent.password script.Parent.MouseButton1Click:Connect(function() if textbox.Text == code.Value then script.Parent.Text = 'Welcome to [UnnAmeD]' wait(2) script.Parent.Text = 'have a nice day [remember to read rules]' wait(4) script.Parent.Parent.Visible = false else script.Parent.Text = 'Incorrect code' wait(2) script.Parent.Text = 'please leave' end end)
[image]
This is in fact very easy and you can do this from server or client. In this case we can kick the player using the local script because we are kicking the client that the code is on so there are no problems. But for kicking other players you will need to use remote events.
local code = script.Parent.Parent.Code local textbox = script.Parent.Parent.password local plr = game:GetService("Players").LocalPlayer script.Parent.MouseButton1Click:Connect(function() if textbox.Text == code.Value then script.Parent.Text = 'Welcome to [UnnAmeD]' wait(2) script.Parent.Text = 'have a nice day [remember to read rules]' wait(4) script.Parent.Parent.Visible = false else script.Parent.Text = 'Incorrect code' wait(2) plr:Kick("Your code is incorrect!") end end)
Enjoy your day and if you have any problems please contact me