Script still kicking all players?

hey im trying to make a min/max character system on my kick script but it’s still kicking the players
heres the script:

script.Parent.MouseButton1Click:Connect(function(player)
	local Player = game.Players.LocalPlayer
	local reason = Player.PlayerGui.AdminPanel.Ui.ScrollingFrame.Reason.Text
	if string.len(reason) <= 10 then
		reason = ("Please Put more charaters in your reason!")
		wait(2)
		reason = ("")
	else
	game.ReplicatedStorage.Events.ServerShutDown:FireServer(reason)
	end
	if string.len(reason)>= 50 then
		reason = ("The reason is too long!")
		wait(2)
		reason = ("")
	else
		game.ReplicatedStorage.Events.ServerShutDown:FireServer(reason)
	end
end)

errors: no errors

You should change it to an elseif system like this

script.Parent.MouseButton1Click:Connect(function(player)
	local Player = game.Players.LocalPlayer
	local reason = Player.PlayerGui.AdminPanel.Ui.ScrollingFrame.Reason.Text
	if string.len(reason) <= 10 then
		reason = ("Please Put more charaters in your reason!")
		wait(2)
		reason = ("")
	elseif string.len(reason)>= 50 then
		reason = ("The reason is too long!")
		wait(2)
		reason = ("")
	else
		game.ReplicatedStorage.Events.ServerShutDown:FireServer(reason)
	end
end)
3 Likes